🐍 Python Fundamentals

Translating our Design into a working program!

1. Input, Output & Assignment

# Assignment & Input
name = input("What is your name? ")
score = 0 # Initializing a variable

# Output
print("Hello", name)

2. Simple Calculations

Python uses standard operators: +, -, *, /.

price = float(input("Price: "))
tax = price * 0.16 # 16% VAT
print("Tax is:", tax)
total = price + tax
print("Total is:", total)