Python Forum
Help needed. Python Newbie!, it will be fun.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help needed. Python Newbie!, it will be fun.
#2
If you want the option to keep playing, you need another loop to put it all into (I think you put it around the end of game stuff, but it needs to go around everything). The format would be something like this:

while True:
    # do all of the set up stuff like initialize the scores.
    while game_not_over:
        # play the game
    if they_didnt_quit:
        # do the end of game stuff like determine and announce who won.
    play_again = input('Do you want to play again (y/n)? ')
    if play_again.lower() != 'y':
        break
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Help needed. Python Newbie!, it will be fun. - by ichabod801 - Oct-10-2019, 10:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python newbie laleebee 2 1,358 May-24-2022, 01:39 PM
Last Post: laleebee
  Python issue - Data science - Help is needed yovel 2 2,042 Jul-29-2021, 04:27 PM
Last Post: yovel
  Help needed for a python package keysson 1 2,253 Sep-02-2020, 03:37 AM
Last Post: Larz60+
  Absolutely new to python - basic advise needed mariolucas75 2 2,102 Jun-12-2020, 08:36 PM
Last Post: Yoriz
  Newbie on Python syntax rud0lp20 6 2,998 Apr-21-2020, 04:26 PM
Last Post: jefsummers
  python newbie marcush929 2 2,637 Jan-01-2020, 08:06 AM
Last Post: marcush929
  Python Linting (newbie) LieveHeer 2 2,656 Jan-24-2019, 05:36 PM
Last Post: LieveHeer
  help needed with python launcher fallenlight 3 3,411 Jan-19-2019, 01:06 PM
Last Post: snippsat
  Python newbie is asking Marcus_Gondwe 4 3,455 Apr-04-2018, 11:08 AM
Last Post: Marcus_Gondwe
  Newbie ? Python 3 Input() jlgrunr 1 2,478 Feb-17-2018, 10:26 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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