๐ Day 3: Basic Arithmetic & Input/Output in Python
Letโs build the foundation of your programming skills with math operations and user input handling!
---
๐ข Basic Arithmetic Operations
---
๐งฎ Order of Operations (PEMDAS)
---
๐ฃ User Input and Output
---
### ๐ Convert Input to Numbers
---
โ Practice Problems
1๏ธโฃ Area of a Rectangle
2๏ธโฃ Square of a Number
3๏ธโฃ Basic Arithmetic Calculator
---
๐ฏ Goal for Day 3
โ Use Pythonโs arithmetic operators confidently
โ Understand input/output with
โ Practice writing small interactive programs
โ
๐จโ๐ป Keep coding! Day 4 coming soon...
#Python #Day3 #LearnToCode #ProgrammingBasics #BeginnerFriendly
Letโs build the foundation of your programming skills with math operations and user input handling!
---
๐ข Basic Arithmetic Operations
print(5 + 3) # Addition โ 8
print(10 - 4) # Subtraction โ 6
print(7 * 2) # Multiplication โ 14
print(15 / 3) # Division โ 5.0
print(15 // 2) # Floor Division โ 7
print(15 % 4) # Modulus โ 3
print(2 ** 3) # Exponentiation โ 8
---
๐งฎ Order of Operations (PEMDAS)
print(2 + 3 * 4) # Output: 14
print((2 + 3) * 4) # Output: 20
---
๐ฃ User Input and Output
name = input("What is your name? ")
print("Hello, " + name + "!")
---
### ๐ Convert Input to Numbers
num1 = int(input("Enter first number: "))
num2 = int(input("Enter second number: "))
print("Sum:", num1 + num2)
---
โ Practice Problems
1๏ธโฃ Area of a Rectangle
length = float(input("Enter length: "))
width = float(input("Enter width: "))
area = length * width
print("Area:", area)
2๏ธโฃ Square of a Number
num = int(input("Enter a number: "))
print("Square:", num ** 2)
3๏ธโฃ Basic Arithmetic Calculator
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
print("Addition:", num1 + num2)
print("Subtraction:", num1 - num2)
print("Multiplication:", num1 * num2)
print("Division:", num1 / num2)
---
๐ฏ Goal for Day 3
โ Use Pythonโs arithmetic operators confidently
โ Understand input/output with
input()
and print()
โ Practice writing small interactive programs
โ
๐จโ๐ป Keep coding! Day 4 coming soon...
#Python #Day3 #LearnToCode #ProgrammingBasics #BeginnerFriendly