Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8022309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:13:51+00:00 2026-06-04T22:13:51+00:00

I’m working on a template for a menu system and I have it sorted

  • 0

I’m working on a template for a menu system and I have it sorted out quite well for a beginner. I’ve had some good help through stackoverflow in the past few days and figured I’d ask what’s wrong here.

Here’s the Code:

# Multitasker
# Allows User to Pick an Item that is Defined.

# This is the initial screen.

print("""
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X                                        X
            X            DEMO MULTITASK DEMO         X
            X                                        X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X                                        X
            X               MULTITASKING             X
            X           --------------------         X
            X             MAIN MENU SYSTEM           X
            X            FOR GAME PLATFORMS          X
            X           --------------------         X
            X                                        X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

                     PRESS 'ENTER' TO CONTINUE""",end=" ")

# Input used to prevent the Multitask Selector Menu from Appearing at First!
input(" ")

# Defining Task 1 
def task1():
    print("""
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X    YOU HAVE CHOSEN TO DISPLAY TASK 1   X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            """, end=" ")

# Defining Task 2
def task2():
    print("""
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X    YOU HAVE CHOSEN TO DISPLAY TASK 2   X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            """, end=" ")

# Defining Task 3
def task3():
    print("""
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X    YOU HAVE CHOSEN TO DISPLAY TASK 3   X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            """, end=" ")

# Defining Task 4
def task4():
    print("""
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X    YOU HAVE CHOSEN TO DISPLAY TASK 4   X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            """, end=" ")

# If the Player Selected an innappropriate task number greater than 4, this will   display.
def notatask():
    print("""
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X     THAT IS NOT A POSSIBLE CHOICE.     X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            """, end=" ")


# Starts choice off as having no selection.
choice = None
playername = " "

# While the variable 'choice' is not '0', it will continue to display the menu below
while choice != "0":
    print(
        """
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X                                        X
            X            MULTITASK SELECTION         X
            X                                        X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X                                        X
            X                0 - Quit                X
            X                1 - Task 1              X
            X                2 - Task 2              X
            X                3 - Task 3              X
            X                4 - Task 4              X
            X                                        X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            """, end=" ")

    choice = int(input("\n\t\tPick a Task Between 0-4:\t#"))
    print()

    # Exit
    if choice == int('0'):
        print("""
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X                                        X
            X            DEMO MULTITASK DEMO         X
            X                                        X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            X                                        X
            X               MULTITASKING             X
            X           --------------------         X
            X             MAIN MENU SYSTEM           X
            X            FOR GAME PLATFORMS          X
            X           --------------------         X
            X                                        X
            XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
            """, end="")
        print("\t\t", playername, end="")
        print("""
                    PRESS 'ENTER' TO CONTINUE""", end=" ")
        input(" ")

    # Task 1
    elif choice == int('1'):
        task1()

    # Task 2
    elif choice == int('2'):
        task2()

    # Task 3
    elif choice == int('3'):
        task3()

    # Task 4
    elif choice == int('4'):
        task4()

    # Not a Correct Selection
    elif choice > int('4'):
        notatask()

    # Enter Key
    elif choice == ('ENTER'):
        notatask()

So, what I don’t understand is what I need to do to make it call notatask() when someone hits a key other than 0, 1, 2, 3, or 4.

Can anybody lead me in the right direction?

Thanks in Advance.

Best,

Steven

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:13:53+00:00Added an answer on June 4, 2026 at 10:13 pm

    After the elif for Task 4, just use an else.

    # Task 4
    elif choice == int('4'):
        task4()
    
    # Everything else
    else:
        notatask()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.