Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a Menu
#5
You ask for a choice before you show the menu. How are they supposed to know what to choose? You need to show the menu, get the choice, and then process the choice (do what they chose).

You don't need the loop on line 14. The replace on line 15 takes care of all the spaces, you just need to run it one. But that replace doesn't change usr_str, it creates a new string without the spaces. You need to assign that to a new variable name, and then print the len() of that new variable.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Creating a Menu - by Sunshine - Jun-25-2019, 12:46 AM
RE: Creating a Menu - by ichabod801 - Jun-25-2019, 02:18 AM
RE: Creating a Menu - by Sunshine - Jun-25-2019, 03:11 AM
RE: Creating a Menu - by jefsummers - Jun-25-2019, 10:40 AM
RE: Creating a Menu - by ichabod801 - Jun-25-2019, 10:54 AM

Forum Jump:

User Panel Messages

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