0% found this document useful (0 votes)
6 views3 pages

Python Basics for Data Science Beginners

This document introduces the basics of Python for Data Science, covering topics such as variables, data types, user input, conditions, loops, and functions. It includes practical examples like a simple calculator and emphasizes the importance of Python in data science due to its ease of use and community support. The lesson concludes with a preview of the next class topics, including lists and a student score tracker project.

Uploaded by

realfawaz01
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Python Basics for Data Science Beginners

This document introduces the basics of Python for Data Science, covering topics such as variables, data types, user input, conditions, loops, and functions. It includes practical examples like a simple calculator and emphasizes the importance of Python in data science due to its ease of use and community support. The lesson concludes with a preview of the next class topics, including lists and a student score tracker project.

Uploaded by

realfawaz01
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python for Data Science - Lesson 1: Basics

Slide 1: Welcome to Data Science

What is Data Science?

• Extracting knowledge from data


• Used in: health, finance, games, social media

Why Learn Python?

• Easy to understand
• Powerful tools for data
• Large community support

Slide 2: First Python Program

print("Hello, Data Science!")

• print() displays output


• This is how we start every Python journey

Slide 3: Variables & Data Types

name = "Abdulrahman" # string


age = 20 # integer
height = 1.75 # float
is_muslim = True # boolean

• Variables store information


• Types matter: string, int, float, bool

Slide 4: Taking User Input

username = input("Enter your name: ")


print("Welcome, " + username)

• input() gets data from the user


• Combine with print() for output

1
Slide 5: Conditions (If Statements)

age = int(input("Enter your age: "))

if age >= 18:


print("You are an adult.")
else:
print("You are still young.")

• Make decisions with if , elif , else

Slide 6: Loops

for i in range(5):
print("Lesson", i + 1)

• for loop repeats code


• range(5) runs 5 times (0 to 4)

Slide 7: Functions

def greet(name):
print("Hello", name)

greet("Abdulrahman")

• Functions let you reuse code


• Use def to define a function

Slide 8: Mini Task - Simple Calculator

num1 = float(input("Enter first number: "))


num2 = float(input("Enter second number: "))
operation = input("Choose operation (+, -, *, /): ")

if operation == "+":
print(num1 + num2)
elif operation == "-":
print(num1 - num2)

2
elif operation == "*":
print(num1 * num2)
elif operation == "/":
print(num1 / num2)
else:
print("Invalid operation")

Slide 9: Wrap Up

Today you learned:

• What Python is
• Variables, Input, Conditions, Loops
• How to write your first function

Next Class:

• Lists, Tuples, Dictionaries


• Student Score Tracker Project

You might also like