Variables and Data Types
Getting comfortable with variables is absolutely crucial - they're basically containers that store information your program needs to remember. You create them using the equals sign, like name = "Bob", and it's that simple.
Here's something important to remember: variables created inside a function stay local to that function (they can't be used elsewhere). However, if you want to make a variable from your main program local to a specific function, just use the local keyword, or make it available everywhere with global.
Casting lets you convert between different data types, which you'll use constantly. The functions str(), int(), and float() are your best mates here - str(3) gives you "3", whilst int("3") gives you the number 3.
Quick Tip: Think of casting like translation - you're converting data from one "language" (type) to another so different parts of your program can understand it.







