Mist
Q:9. What should come in place of X if we
want to print HI! 6 times?
for i in range(x):
print('HI!")
1. 1.5
2. 1,6
3. 5
4. 1,7
Must
Answers
Answered by
3
Answer:
Option 4: 1,7
Códe:-
for i in range(1,7):
print('HI!")
Required Output:-
Hi!
Hi!
Hi!
Hi!
Hi!
Hi!
Syntax of for loop in python
for I in range(initial value, final value, increment value):
statement 1
statement 2
Points to remember:-
- In python, I loop works 1 less than the final value given by the user.
- Do not forget to give colon(:) after for I in range()
- Python is indentation supportive. Do not forget to give indentation before statement(s) inside for loop otherwise you won't get desired output.
Similar questions