Example
Creating Variables
Variables store data in your program. Learning to create and name variables in Python.
Showing 1–10 of 53
Example
Variables store data in your program. Learning to create and name variables in Python.
Quiz
Free beginner quiz on Python variables: 15 questions on naming, assignment, data types, type conversion and scope, with instant answers.
Article Python Fundamentals
Learn Python variables and data types - the building blocks of programming. Discover how to store numbers, text, and complex data structures effectively while following best practices for clean and…
Example
Local variables exist only inside functions. Global ones are accessible everywhere.
Quiz
Free beginner quiz on Python variable scope: 15 questions on local and global variables, the global and nonlocal keywords, and nested functions.
Challenge
Predict, investigate and extend a mission config held in variables: text, whole numbers, decimals and True/False. A PRIMM challenge on Python data types.
Challenge
…a battery through one orbit. A PRIMM challenge on updating variables.
Challenge
…using or, then name the rule that fired with boolean variables and an if/elif chain.
Challenge
…a quick calculation for the cargo module and called the variables a , b , x2 and tmp . The program works, but nobody, including its author a month from now, can tell what it calculates without working…
Challenge
…assigns to fuel_kg inside the function, creating a local variable and leaving the global fuel unchanged. Predict the last line, compare both values, fix it by returning the total, then write a…