Python - Variables and Dynamic Typing
Which of the following Python statements correctly assigns the integer 42 to a variable named
answer?answer?answer = 42. int answer = 42 is invalid because Python does not require or allow type declarations like int. answer := 42 uses the walrus operator (:=), which is valid in Python 3.8+, but is used for expressions, not standard assignment. var answer = 42 uses var, which is not a Python keyword.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions