def main(): print("What mode do you want?") print("peaceful - 12 tries, 1-20") print("easy - 10 tries, 1-40") print("medium - 8 tries, 1-60") print("hard - 6 tries, 1-80") print("expert - 4 tries, 1-100") print("impossible - 2 tries, 1-150") print("custom - You Choose") print("random - Random!") x = input('mode> ') if x == 'peaceful': tries = 12 start = 1 end = 20 elif x == 'easy': tries = 10 start = 1 end = 40 elif x == 'medium': tries = 8 start = 1 end = 60 elif x == 'hard': tries = 6 start = 1 end = 80 elif x == 'expert': tries = 4 start = 1 end = 100 elif x == 'impossible': tries = 2 start = 1 end = 150 elif x == 'custom': while True: print("How many tries do you their to be?") tries = input('tries> ') try: tries = int(tries) if tries < 0: print("Hey, your input is too small") continue break except: print("You have to enter a number") while True: print("What do you want the start to be") start = input('start> ') try: start = int(start) break except: print("You have to enter a number") while True: print("What do you want the end of the range to be to be") end = input('end> ') try: end = int(end) break except: print("You have to enter a number") elif x == 'random': import random tries = random.randint(1, 100) start = random.randint(-100, 100) end = random.randint(start, 100) print(str(tries) + " tries") print(str(start) + " - " + str(end)) else: print("Hey, " + x + " is not an aviable mode") main() import random x = random.randint(start, end) #print(x) i = 1 done = False while True: print("Geuss #" + str(i)) try: y = int(input('guess> ')) if y < start: print("The number has to be between " + str(start) + " and " + str(end)) continue if y > end: print("The number has to be between " + str(start) + " and " + str(end)) continue if y < x: print("Too small") if y > x: print("Too big") if y == x: print("You got it in " + str(i) + " tries!") done = True except: print("Your input has to be a number") continue if done == True: break if i == tries: break i += 1 if done == False: print("You didn't get it") print("The number was " + str(x)) import random title = "Guess the Number" about = 'Guess the number with many difficulties in a certan numbeer of tries' game = True if __name__ == '__main__': main()