Computer Science · Variables
A student uses the augmented assignment operator: total += 5. If the variable 'total' was never defined earlier in the program, what will happen in Python?
- 1It initializes 'total' with a value of 5
- 2It raises a NameError✓
- 3It performs string concatenation
- 4It evaluates the expression to None
Correct answer
It raises a NameError
Download Single Question PDF
Save this question and verified answer as a clean study sheet with live clickable link.
Share with Friends & Study Groups
Challenge your peer aspirants on WhatsApp or Telegram to solve this question!
Preparing for Computer Science?
Practice full-length mock tests with real exam timers, instant score analysis, and all-India ranking.
Want more practice questions on Variables?
Solve complete topic-wise tests with detailed solutions on GkGet.
Related Practice Questions
Recommended practice questions in Computer Science · Variables