Python Forum
so im trying to make a question game for school and im trying to make it when some on
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
so im trying to make a question game for school and im trying to make it when some on
#1
so im trying to make a question game for school and im trying to make it when some on says no it stops the user from putting the inputs in but still lets the person that says yes to continue the game. im new to programing so anything will help





print('what is your name')

name = input()

print('hello '+ name )

print('do you want to play a game today ')

answer = input()
if answer == 'yes':
    print('okay lets play ')

if answer == 'no':
    print('okay have a good day ')
if answer == 'no':
    breakpoint(input)

if answer == 'yes':
    print('if you were in a band what would you play')
music = input()
print(music + ' that is cool')

if answer == 'yes':
    print('If you had to run away from everyone then where would you hide yourself?')
place = input()
print(place + ' clever')

if answer == 'yes':
    print('What is your favorite type of candy?')
candy = input()
print(candy + ' sweet ')
Reply
#2
The program will as for music, place, and candy, no matter if there was a yes or no input. Some testing is called for.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [pyparsing] How to make my simple parser fault tolerant medihack 0 58 Yesterday, 04:52 PM
Last Post: medihack
  Make entire script run again every 45 mo NDillard 0 353 Jan-23-2024, 09:40 PM
Last Post: NDillard
  hi need help to make this code work correctly atulkul1985 5 866 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  Trying to make a board with turtle, nothing happens when running script Quascia 3 743 Nov-01-2023, 03:11 PM
Last Post: deanhystad
  newbie question - can't make code work tronic72 2 735 Oct-22-2023, 09:08 PM
Last Post: tronic72
  Cleaning my code to make it more efficient BSDevo 13 1,478 Sep-27-2023, 10:39 PM
Last Post: BSDevo
  Trying to make a password generator Jankofcik 1 572 Aug-06-2023, 01:22 PM
Last Post: deanhystad
  Why do I have to repeat items in list slices in order to make this work? Pythonica 7 1,418 May-22-2023, 10:39 PM
Last Post: ICanIBB
  I'm trying to make my Alexa/Echo dot 3 powered by ChatGPT.... mariozio 1 1,038 Apr-20-2023, 05:24 PM
Last Post: farshid
  how to make bot that sends instagram auto password reset code kraixx 2 1,457 Mar-04-2023, 09:59 PM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020