Bird
0
0

Which of the following is the correct way to assign the value 10 to a variable named 'score' in Python?

easy📝 Syntax Q3 of 15
Python - Basics and Execution Environment
Which of the following is the correct way to assign the value 10 to a variable named 'score' in Python?
Ascore = 10
B10 = score
Cint score = 10
Dscore == 10
Step-by-Step Solution
Solution:
  1. Step 1: Recall Python variable assignment syntax

    In Python, single equals sign '=' assigns a value to a variable.
  2. Step 2: Check each option

    score == 10 uses '==' which is a comparison, not assignment. 10 = score tries to assign to a literal, syntax error. int score = 10 uses type declaration not needed in Python.
  3. Final Answer:

    score = 10 -> Option A
  4. Quick Check:

    Use '=' for assignment [OK]
Quick Trick: Use '=' to assign values in Python [OK]
Common Mistakes:
MISTAKES
  • Using '==' instead of '='
  • Adding type declarations
  • Trying to assign to a literal like '10 = score'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes