Learn with Yasir

Share Your Feedback

Fill-in-the-Blanks Variables in Python | Practice & Progress


Level up your Python skills with interactive fill‑in‑the‑blanks exercises! Practice variable declaration, assignment, and usage in bite‑sized challenges.

🔍 Fill in the Blanks

🟢 Beginner

  1. Variable names in Python must start with a letter or an __________.
  2. Answer

    underscore

    Python variable names can begin with a letter (a-z, A-Z) or underscore (_), but not numbers or other characters.


  3. The assignment operator in Python is the __________ symbol.
  4. Answer

    equals

    The equals sign (=) is used for assignment in Python (e.g., x = 5).


  5. In Python, variable names are case-__________.
  6. Answer

    sensitive

    Python treats myVar and myvar as different variables.


  7. The __________ keyword is used to delete a variable in Python.
  8. Answer

    del

    The del statement removes the binding of a variable.


  9. The special value representing 'no value' in Python is __________.
  10. Answer

    None

    None is Python's null/nothing value.


🟡 Intermediate

  1. Variables in Python are __________, meaning they can change type when assigned a new value.
  2. Answer

    dynamic

    Python uses dynamic typing, allowing variables to hold values of any type and change types during execution.


  3. Python variables are actually __________ to objects in memory.
  4. Answer

    references

    Variables store references to objects rather than containing the objects themselves.


  5. Python checks variable types at __________ rather than compile time.
  6. Answer

    runtime

    This is why Python is called a dynamically typed language.


  7. When you assign a = b, both variables become __________ to the same object.
  8. Answer

    references

    Assignment creates a new reference, not a copy of the object.


  9. Functions without a return statement implicitly return __________.
  10. Answer

    None

    This is why print(my_function()) shows None when the function has no return.


🔴 Advanced

  1. The __________ function can be used to check a variable's current type.
  2. Answer

    type

    type(x) returns the class/type of object x currently references.


  3. To properly check for None, you should use the __________ operator rather than ==.
  4. Answer

    is

    The 'is' operator checks for identity with the None singleton.




📚 Related Resources


🧠 Practice & Progress