The purpose of the following code is to print an “Attempting connection” message while the value of the count variable is less than 10. The value of count should increase by 1 with each iteration of the loop. What is wrong with the code? Select all that apply.

Automate Cybersecurity Tasks with Python | Weekly challenge 1 Quiz | 

The purpose of the following code is to print an “Attempting connection” message while the value of the count variable is less than 10. The value of count should increase by 1 with each iteration of the loop. What is wrong with the code? Select all that apply.

count = 1
while count < 10:
print("Attempting connection")
count = count + 1
  • The line with print(“Attempting connection”) is not indented.
  • The line with count = count + 1 is not indented.
  • The line with count = 1 is not indented
  • The line with while count < 10: is not indented.

 

Leave a Comment