Python is dynamically typed. Variables are created when you assign a value. Common types: int, float, str, bool, list, dict, tuple.
# Example: Variable assignment and type checking
name = "Alice"
age = 30
height = 5.7
is_active = True
print(f"{name} is {age} years old")
print(type(age)) # <class 'int'>Given variables a = 5 and b = 10, swap their values and print them.
Loading Python runtime (Pyodide)...
Convert the string "42" to an integer, add 8 to it, and print the result.
Loading Python runtime (Pyodide)...
Given name="Data" and score=95, print "Data scored 95 points" using an f-string.
Loading Python runtime (Pyodide)...