Assign a Python Variable
Fill in the BlankBeginner
Question
Fill in the blank to assign the value 42 to a variable named `answer`.
Code
answer ___ 42
Hint
Python uses a single symbol for assignment.
Explanation
Python uses the single equals sign = for assignment. The completed line is: answer = 42. Note that Python uses == for comparison and = for assignment, unlike some languages that use := or other operators.
Related Resources
Related Lessons
- Python Variables
Learn how to assign variables in Python.
Related Cheatsheets
- Python Cheatsheet
Quick reference for Python syntax.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.