- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython While Loops
More file actions
Latest commit
11 lines (9 loc) · 480 Bytes
/
Copy pathPython While Loops
File metadata and controls
11 lines (9 loc) · 480 Bytes
1
2
3
4
5
6
7
8
9
10
11
print_str = "Water falls"
# TODO: initialize a counting variable "i" to 0 - you'll use this to track which character of the string you're on
i = 0
# TODO: write your while header line, comparing "i" to the length of the string
while i < len(print_str):
print(print_str[i])
i += 1
# TODO: here in the body of the loop, print out the current character from the string
# TODO: increment your counter variable in the body of the loop, so you don't loop forever!