subject

Consider the following code:
a) num = int(input("enter a number, negative to stop"))
b) while (num > = 0):
print ("you entered: " + str(num))
c) num = int(input("enter a number, negative to stop"))
print ("done.")
what is wrong?
d) the num > = 0 test condition is not correct
there is nothing wrong with the code.
the line num = int(input("enter a number, negative to stop")) should be indented so it is inside the loop
e) there should not be a : after the while (num > = 0)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:00
Our primary purpouse as electricians is to do wich of the following core concepts? a: install electrical components in a way they can be upgraded b: install electrical equiptment in a way that reduces heat c: install electrical systems in a safe manner d: only b and c
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 22:30
How many points do i need before i can send a chat
Answers: 1
You know the right answer?
Consider the following code:
a) num = int(input("enter a number, negative to stop"))
b)...
Questions
question
Mathematics, 15.10.2020 08:01
Questions on the website: 13722363