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:
Step 1: Recall Python variable assignment syntax
In Python, single equals sign '=' assigns a value to a variable.
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.
Final Answer:
score = 10 -> Option A
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'
Master "Basics and Execution Environment" in Python
9 interactive learning modes - each teaches the same concept differently