Jump to content
xisto Community

ROTNR

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Hey there guys/girls, So, I have been working in Python for about a Month now, and have learned a lot. It seems similar to other programming languages I have used in the past (PHP, some C/C++). But I still have a few questions, so here is a sample of one of my codes. ##########Help #File#For #(Program name here)########import syshelp="""1. What is this?2. How does this work?3. What did you make this in?4. Back5. Quit"""print helphline = raw_input("Please select 1-5 above: ")while hline not in ('1','2','3','4','5'): hline = raw_input("Please select a number between 1 and five: ")if hline == '1': print("This is a program duh")while hline not in ('1','2','3','4','5'): hline = raw_input("Please enter a number between 1 and 5: ")if hline == '2': print("Through programming :-p")while hline not in ('1','2','3','4','5'): hline = raw_input("Please enter a number between 1 and 5: ")if hline == '3': print ("Python")while hline not in ('1','2','3','4','5'): hline = raw_input("Please enter a number between 1 and 5: ")if hline == '4': import index.pywhile hline not in ('1','2','3','4','5'): hline = raw_input("Please enter a number between 1 and 5: ")if hline == 5: sys.exit()Okay, so I was wondering if there was an easier way to do this... I have tried elif , but it doesn't seem to work correctly. Also, whenever it brings me back to the start page and I go back to the help file and try to get back to the start page, it always just ends the program. Thanks in advance, -Pete
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.