Read the following code: x = 1 (x < 26): print(x) x = x + 1 There is an error in the while loop. What should be fixed? Add quotation marks around the relational operator Begin the statement with the proper keyword to start the loop Change the parentheses around the test condition to quotation marks Change the colon to a semicolon at the end of the statement
Am I right with D?
@vocaloid
python uses colons for loops, not semi-colons, so it wouldn't be D however, if you want to use a while loop, you need the word "while" in front of the condition
hmm so C?
not quite, for python you use parentheses around the condition not quotation marks think about the other example: it didn't just say (n < 5), it said while (n < 5) "while" is the keyword to start the loop, so choice B
oohh ok thank you
Join our real-time social learning platform and learn together with your friends!