Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python help
#2
Please use python tags. See the BBCode link in the tutorials in my signature.

If you want to use the % operator for string formatting, you need to have it inside the parenthesis for the print call:

print("so you are a %s, %s and you are level 0" % (gender, _class))
You might want to look into the format method of strings:

print("so you are a {}, {} and your are level 0".format(gender, _class))
You might also note that your check for a valid class doesn't really do anything. And you might want to check out the text adventure tutorial link in my signature.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
python help - by ython_skyy - Jul-08-2017, 09:01 PM
RE: python help - by ichabod801 - Jul-08-2017, 10:48 PM

Forum Jump:

User Panel Messages

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