- 3

Please explain if possible:

What's the output? X =1 While x<5: If x==3: Print (x+10) X+=1 Answer: 13

21st Jul 2020, 1:42 PM
A.13S.
4 Answers
+ 4
•X is one. •X gets added if X is not equal to three. •When X is 3 it is printed after adding 10. •X keeps getting adding until it reaches 5.
21st Jul 2020, 1:45 PM
Saphal Poudyal
Saphal Poudyal - avatar
+ 1
== checks if two values are equal = assigns a value to a variable if x == 3 -> if x is equal to 3
21st Jul 2020, 2:43 PM
Denise Roßberg
Denise Roßberg - avatar
0
SAVAGE and Ćheyat thank you!
21st Jul 2020, 2:30 PM
A.13S.
0
Ćheyat, == might mean equals in a statement, rather then giving a variable a value (=). But you could be right, it's always confused me
21st Jul 2020, 2:32 PM
A.13S.