0% found this document useful (0 votes)
5 views4 pages

Python Basics: Print, Variables, Math

this teacches the basic of python with some coding

Uploaded by

sardominates
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)
5 views4 pages

Python Basics: Print, Variables, Math

this teacches the basic of python with some coding

Uploaded by

sardominates
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

🧑🏻‍💻

Coding
📝Variables)
Day 1 — Python Basics (Print, Numbers,

🔹 1. Printing
print() shows text or numbers on the screen.

Text must be inside quotes "" .

Numbers don’t need quotes.

print("Bananas are awesome!")


print(10 + 5)

✔ Output:
Bananas are awesome!
15

Coding 1
🔹 2. Data Types
String → text, inside quotes → "hello" , "banana"

Integer → whole numbers → 5 , 100 , 7

Float → decimal numbers → 3.5 , 2.0

Boolean → True/False values → True , False

🔹 3. Variables
A variable stores a value (like a box with a label).

Use = to assign a value.

No quotes when printing the variable.

fruit = "Banana"
age = 12
pi = 3.14

print(fruit)
print(age)
print(pi)

✔ Output:
Banana
12
3.14

🔹 4. Math Operators
+ add

subtract

Coding 2
multiply

/ divide (float result)

// floor divide (no decimals)

% modulo (remainder)

* power

print(7 + 3) # 10
print(10 - 2) # 8
print(6 * 4) # 24
print(9 / 2) # 4.5
print(9 // 2) # 4
print(9 % 2) # 1
print(2 ** 3) # 8

📝 Day 1 — Practice Questions


1. Text Output
Write a program that prints:

Hello, my name is Sar!

2. Simple Math

Print the result of:

27 + 15

50 - 23

9*6

3. Division Practice
Print:

Coding 3
10 / 3

10 // 3

10 % 3

4. Variables

Create a variable called name with your name, and age with your age. Print
them both like this:

My name is ___ and I am ___ years old.

5. More Variables

Store length = 5 and width = 3 .


Print the area of the rectangle (length × width).

6. Challenge Question

Make a variable number = 13 .

Print:

“Even” if the number is even.

“Odd” if the number is odd.

Coding 4

You might also like