Challenge
Names that explain
…uses a, b, x2 and tmp. Predict it, work out what each name holds, rename them so the code explains itself, then write a fuel check with good names.
Showing 1–10 of 36
Challenge
…uses a, b, x2 and tmp. Predict it, work out what each name holds, rename them so the code explains itself, then write a fuel check with good names.
Quiz
Free beginner quiz on Python variables: 15 questions on naming, assignment, data types, type conversion and scope, with instant answers.
Quiz
Free beginner quiz on Python variable scope: 15 questions on local and global variables, the global and nonlocal keywords, and nested functions.
Article Python Fundamentals
…what the second version does. In the Mars examples, we use names like x_position , y_position , scan_x , rover_id - anything that helps understand the code. Practical Example: Searching for Lost…
Example
Namespaces isolate variables. Modules and functions create their own namespaces.
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
Variables store data in your program. Learning to create and name variables in Python.
Example
Local variables exist only inside functions. Global ones are accessible everywhere.
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.
Example
Operator ** allows accepting any number of keyword arguments.