Python Forum
Mad-lib script (beginner)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mad-lib script (beginner)
#2
Congratulation on creating your first python program

You could try to change all your string concatenations to use the preferred Formatted string literals
Here is an example of one of your print lines
print("Pizza was invented by a " + adj + nationality + "chef named " + person)
as an f string
print(f"Pizza was invented by a {adj}{nationality}chef named {person}")
when you get the hang of them they are quite easy to use
Basically you just add an f in front of the string and your variables are directly inside of the string quotes and contained in between {}

(Jun-19-2020, 11:47 AM)eddiemyson Wrote: please delete this thread until I can figure out the bbcode.

There is no need to delete the thread, you'll get the hang of using code tags, in the meantime, I put them in for you.
Reply


Messages In This Thread
Mad-lib script (beginner) - by eddiemyson - Jun-19-2020, 11:47 AM
RE: Mad-lib script (beginner) - by Yoriz - Jun-19-2020, 12:18 PM

Forum Jump:

User Panel Messages

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