6.1k views
2 votes
What would the following code do?
while True :
print("Hello")

User Thebaron
by
5.1k points

2 Answers

6 votes
Answer: Will just keep printing “Hello”

Explanation: when you pass a value to a whole loop let’s say it’s called “var1” if u just submit the variable to the whole loop like ‘while var1’ it will run the code in the block while var1 is true '!while var1' for the opposite, so when you pass 'while True' it will keep running the code while True is equal to True which it always will
User Bob Mason
by
4.5k points
9 votes

Answer:

If it is true then it will write hello

User Skytz
by
4.9k points