CompTIA
PT0-002 · Question #83
Which of the following expressions in Python increase a variable val by one (Choose two.)
The correct answer is C. val=(val+1) F. val+=1. https://pythonguides.com/increment-and-decrement-operators-in-python/
Tools and Code Analysis
Question
Which of the following expressions in Python increase a variable val by one (Choose two.)
Options
- Aval++
- B+val
- Cval=(val+1)
- D++val
- Eval=val++
- Fval+=1
How the community answered
(43 responses)- A2% (1)
- B5% (2)
- C91% (39)
- E2% (1)
Explanation
https://pythonguides.com/increment-and-decrement-operators-in-python/
Topics
#Python#Variables#Operators#Increment
Community Discussion
No community discussion yet for this question.