Topic: Understanding strings, integers, floats, booleans
Code prompt: name = "Jake" age = 30 is_consultant = True print(f"{name} is {age} years old. Consultant: {is_consultant}")
Details: Practice declaring variables and printing their values.
In Python, a variable is a name that refers to a value stored in memory. You can think of it as a label for data. Variables allow you to store, retrieve, and manipulate data throughout your program.
You can declare them use the ‘=’ operator:
example_variable = my_variable
x = 10 # intege x = "ten" # now a string
There are a few data types in python, and they all do different things:
int – Integer numbers (e.g., 5, 3, 100)float – Floating-point numbers (e.g., 3.14, 0.001)complex – Complex numbers (e.g., 2 + 3j)str – String of characters (e.g., "Hello", 'Jake')