lundi 17 octobre 2022

How do I make this random package pyrhon project run? [closed]

I cant make my code run on VSC it just dosent want to open or run the program and on PyCharm it says 'Process finished with exit code 0'.

Here's the code:

import random

def code():

  try:
    winning_number = random.randint(0, 50)
    player_input = int(input('''
    Pick Your Number:
     '''))
  
    Win = False
    NoError = True

    if player_input < 0:
      print('Invalid Input')
      NoError = False
    
    if player_input > 50:
      print('Invalid Input')
      NoError = False

    if  player_input == winning_number:
      Win = True

    if NoError == False:
      code()
    
    if Win == True:
      print('Congratulations, You Won!')
    else:
      print('''Sorry, you have lost.
      The winning number is:''')
      print(winning_number)

  except ValueError:
    print('Invalid Input')

def input():
  def help():
    print('''Type HELP for help
    Type QUIT to quit
    Type PLAY to play''')

  def start():
    start_input = (input('Type PLAY to play or HELP for help.'))

    if start_input == 'PLAY':
      code()

    if start_input == 'HELP':
      help()

    if start_input == 'QUIT':
      quit()

input



Aucun commentaire:

Enregistrer un commentaire