Python: small scripts, useful progress
Assign a variable with = and inspect its type using type(). Strings and numbers behave differently. Practice: calculate a total and print a clear message.
Python: small scripts, useful progress
Variables and types
Assign a variable with = and inspect its type using type(). Strings and numbers behave differently. Practice: calculate a total and print a clear message.
Functions and conditions
Functions package reusable behavior. Define a function that accepts quantity and price, returns their product, and rejects negative values. Use if statements for decisions.
Lists and loops
Iterate through a list with for. Practice: sum positive values from [4, -2, 8] and explain why the result is 12. Try an empty list too.
Your next step
Try the exercises with a small dataset. Write down your assumptions, check the results against the source, and explain one thing you would improve.
