Adding as many examples as I've converted so far.

This commit is contained in:
2022-12-10 17:18:44 -05:00
parent 0aa0875c42
commit 543bc78e51
21 changed files with 161 additions and 3 deletions

View File

@@ -0,0 +1 @@
Write a program that generates a random number, and repeatedly asks the user to guess the number, telling them if they're too low, too high, or if they guess correctly. The program should end once they guess the correct number.

View File

@@ -0,0 +1,16 @@
import random
randomValue = random.randint(1, 100)
guess = -1
while randomValue != guess:
guess = int(input("Guess the number: "))
if guess < randomValue:
print("You're too low")
elif guess > randomValue:
print("You're too high")
else:
print("You guessed the right number")

View File

@@ -0,0 +1,19 @@
for i in range(10):
if i == 2 or i == 5:
continue
elif i == 7:
break
print("For Index Number: " + str(i))
counter = 0
while counter < 10:
if counter == 2 or counter == 5:
counter += 1
continue
elif counter == 7:
break
print("While Index Number: " + counter)
counter += 1