update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
15
.config/Code/User/History/-4c5b63ed/5jOS.py
Normal file
15
.config/Code/User/History/-4c5b63ed/5jOS.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
guess = int(input('guess the number: '))
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
18
.config/Code/User/History/-4c5b63ed/BLF4.py
Normal file
18
.config/Code/User/History/-4c5b63ed/BLF4.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
try:
|
||||
guess = int(input('guess the number: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
19
.config/Code/User/History/-4c5b63ed/D53Q.py
Normal file
19
.config/Code/User/History/-4c5b63ed/D53Q.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
try:
|
||||
guess = int(input('guess the number: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
15
.config/Code/User/History/-4c5b63ed/E2Ar.py
Normal file
15
.config/Code/User/History/-4c5b63ed/E2Ar.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
guess = int(input('guess the number: '))
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
16
.config/Code/User/History/-4c5b63ed/HL8Q.py
Normal file
16
.config/Code/User/History/-4c5b63ed/HL8Q.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
guess = int(input('guess the number: '))
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
|
||||
26
.config/Code/User/History/-4c5b63ed/HmJB.py
Normal file
26
.config/Code/User/History/-4c5b63ed/HmJB.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str):
|
||||
for c in number:
|
||||
if c not in num_characters:
|
||||
number = number.replace(c, '')
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
19
.config/Code/User/History/-4c5b63ed/IdHc.py
Normal file
19
.config/Code/User/History/-4c5b63ed/IdHc.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
try:
|
||||
guess = int(input('guess the number: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
23
.config/Code/User/History/-4c5b63ed/ORYk.py
Normal file
23
.config/Code/User/History/-4c5b63ed/ORYk.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i = i + 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
28
.config/Code/User/History/-4c5b63ed/P5or.py
Normal file
28
.config/Code/User/History/-4c5b63ed/P5or.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str) -> str:
|
||||
for c in number:
|
||||
if c not in num_characters:
|
||||
number = number.replace(c, '')
|
||||
return number
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
guess = removeCharacters(guess)
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
23
.config/Code/User/History/-4c5b63ed/PPx1.py
Normal file
23
.config/Code/User/History/-4c5b63ed/PPx1.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
19
.config/Code/User/History/-4c5b63ed/PrjJ.py
Normal file
19
.config/Code/User/History/-4c5b63ed/PrjJ.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
try:
|
||||
guess = int(input('guess the number: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
12
.config/Code/User/History/-4c5b63ed/Siog.py
Normal file
12
.config/Code/User/History/-4c5b63ed/Siog.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
guess = input('guess the number')
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly')
|
||||
break
|
||||
else:
|
||||
print('incorrect guess try again')
|
||||
|
||||
27
.config/Code/User/History/-4c5b63ed/TBwj.py
Normal file
27
.config/Code/User/History/-4c5b63ed/TBwj.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import random
|
||||
|
||||
def removeCharacters(number: str):
|
||||
for c in number:
|
||||
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
29
.config/Code/User/History/-4c5b63ed/UQvG.py
Normal file
29
.config/Code/User/History/-4c5b63ed/UQvG.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import random
|
||||
|
||||
num_characters = ('1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str):
|
||||
for c in number:
|
||||
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
14
.config/Code/User/History/-4c5b63ed/UZi6.py
Normal file
14
.config/Code/User/History/-4c5b63ed/UZi6.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
guess = input('guess the number')
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again')
|
||||
else:
|
||||
print('too low try again')
|
||||
|
||||
3
.config/Code/User/History/-4c5b63ed/V3DZ.py
Normal file
3
.config/Code/User/History/-4c5b63ed/V3DZ.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
20
.config/Code/User/History/-4c5b63ed/XG28.py
Normal file
20
.config/Code/User/History/-4c5b63ed/XG28.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i = i + 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
2
.config/Code/User/History/-4c5b63ed/bESg.py
Normal file
2
.config/Code/User/History/-4c5b63ed/bESg.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import random
|
||||
|
||||
28
.config/Code/User/History/-4c5b63ed/bT9O.py
Normal file
28
.config/Code/User/History/-4c5b63ed/bT9O.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str) -> str:
|
||||
for c in number:
|
||||
if c not in num_characters:
|
||||
number = number.replace(c, '')
|
||||
return number
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
2
.config/Code/User/History/-4c5b63ed/de0y.py
Normal file
2
.config/Code/User/History/-4c5b63ed/de0y.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import random
|
||||
|
||||
1
.config/Code/User/History/-4c5b63ed/entries.json
Normal file
1
.config/Code/User/History/-4c5b63ed/entries.json
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Python/IDS/Assg1/q2.py","entries":[{"id":"bESg.py","timestamp":1725342468167},{"id":"de0y.py","timestamp":1725342482075},{"id":"V3DZ.py","timestamp":1725342515796},{"id":"Siog.py","timestamp":1725342606073},{"id":"UZi6.py","timestamp":1725342821122},{"id":"l9z1.py","timestamp":1725342861916},{"id":"iWR7.py","timestamp":1725342883175},{"id":"HL8Q.py","timestamp":1725342919581},{"id":"5jOS.py","timestamp":1725342950147},{"id":"E2Ar.py","timestamp":1725347094089},{"id":"BLF4.py","timestamp":1725347159945},{"id":"IdHc.py","timestamp":1725347176231},{"id":"PrjJ.py","timestamp":1725347188501},{"id":"D53Q.py","timestamp":1725347209058},{"id":"urc0.py","timestamp":1725347304274},{"id":"XG28.py","timestamp":1725347488362},{"id":"ORYk.py","timestamp":1725347575295},{"id":"PPx1.py","timestamp":1725347814755},{"id":"TBwj.py","timestamp":1725348680732},{"id":"UQvG.py","timestamp":1725348734996},{"id":"lOqr.py","timestamp":1725348746459},{"id":"vhO4.py","timestamp":1725348758493},{"id":"g6xA.py","timestamp":1725348780373},{"id":"HmJB.py","timestamp":1725348791584},{"id":"bT9O.py","timestamp":1725348813906},{"id":"P5or.py","timestamp":1725348825563},{"id":"r8JY.py","timestamp":1725348851193},{"id":"iqmd.py","timestamp":1725348917731}]}
|
||||
30
.config/Code/User/History/-4c5b63ed/g6xA.py
Normal file
30
.config/Code/User/History/-4c5b63ed/g6xA.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str):
|
||||
for c in number:
|
||||
if c not in num_characters:
|
||||
number = number.replace(c, '')
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
16
.config/Code/User/History/-4c5b63ed/iWR7.py
Normal file
16
.config/Code/User/History/-4c5b63ed/iWR7.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
guess = int(input('guess the number'))
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again')
|
||||
else:
|
||||
print('too low try again')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
|
||||
32
.config/Code/User/History/-4c5b63ed/iqmd.py
Normal file
32
.config/Code/User/History/-4c5b63ed/iqmd.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str) -> str:
|
||||
for c in number:
|
||||
if c not in num_characters:
|
||||
number = number.replace(c, '')
|
||||
return number
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
guess = input('guess the number btw 1 and 100: ')
|
||||
guess = removeCharacters(guess)
|
||||
if len(guess) == 0:
|
||||
print('invalid input')
|
||||
continue
|
||||
guess = int(guess)
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
16
.config/Code/User/History/-4c5b63ed/l9z1.py
Normal file
16
.config/Code/User/History/-4c5b63ed/l9z1.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
|
||||
for i in range(5):
|
||||
guess = input('guess the number')
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again')
|
||||
else:
|
||||
print('too low try again')
|
||||
|
||||
print('you failed the number was ', num)
|
||||
|
||||
29
.config/Code/User/History/-4c5b63ed/lOqr.py
Normal file
29
.config/Code/User/History/-4c5b63ed/lOqr.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str):
|
||||
for c in number:
|
||||
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
31
.config/Code/User/History/-4c5b63ed/r8JY.py
Normal file
31
.config/Code/User/History/-4c5b63ed/r8JY.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str) -> str:
|
||||
for c in number:
|
||||
if c not in num_characters:
|
||||
number = number.replace(c, '')
|
||||
return number
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
guess = removeCharacters(guess)
|
||||
if len(guess) == 0:
|
||||
print('invalid input')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
21
.config/Code/User/History/-4c5b63ed/urc0.py
Normal file
21
.config/Code/User/History/-4c5b63ed/urc0.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import random
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
i = i - 1
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i = i + 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
29
.config/Code/User/History/-4c5b63ed/vhO4.py
Normal file
29
.config/Code/User/History/-4c5b63ed/vhO4.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import random
|
||||
|
||||
num_characters = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
|
||||
|
||||
def removeCharacters(number: str):
|
||||
for c in number:
|
||||
if c not in num_characters
|
||||
|
||||
num = random.randint(1, 100)
|
||||
i = 0
|
||||
while i < 5:
|
||||
try:
|
||||
guess = int(input('guess the number btw 1 and 100: '))
|
||||
except ValueError:
|
||||
print('enter a number please')
|
||||
continue
|
||||
if guess < 1 or guess > 100:
|
||||
print('enter number in range please')
|
||||
continue
|
||||
if guess == num:
|
||||
print('congratualtions you guessed correctly: ')
|
||||
break
|
||||
elif guess > num:
|
||||
print('too high try again: ')
|
||||
else:
|
||||
print('too low try again: ')
|
||||
i += 1
|
||||
|
||||
print('you failed the number was ', num)
|
||||
Loading…
Add table
Add a link
Reference in a new issue