-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhileLoops.py
49 lines (37 loc) · 1016 Bytes
/
whileLoops.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# whileLoops.py
# Loops allow Python and other programming languages to repeat
# simple behaviors many times in order to create more complex
# behaviors.
# two main types: for and while
import time
def printToX(x):
val = 1
while val <= x:
print(str(val))
val = val + 1
time.sleep(2)
return "Done!"
def threeGuesses():
secretNumber = 69
guess = False
guesses = 3
while guess == False and guesses > 0:
ans = input("guess my secwet number UwU ")
ans = int(ans)
if ans == secretNumber:
guess = True
else:
print("no u got it wrong LOL, guess again smh")
guesses = guesses - 1
if guess == True:
print("pog you actually got it. now finish your homework lmao")
else:
print("bro you ran out of guesses.. go back to kindergarten")
def highOrLow():
return None
def factorial(x):
return None
def isItPrime(x):
return None
def rollNDice(n):
return None