Oct-15-2018, 02:14 AM
Hello. I wrote the below code in Python 3. I am having trouble getting the \t out of my strings and making the items in the list stack vertically. Can not seem to figure this out. Please help.
#Mardi Gras Event Schedule #Written by Charles Gibson in Python 3 #Begin Application #Text string to give user instructions for input print("Madi Gras Event Schedule") print() print("Dates: 02/10/2018 - 02/13/2018") print("Format Example mm/dd/yyyy") print() #opt function def opt(): eventDate = input("Please select a date") if (eventDate == "02/10/2018"): print(febTenArry) if (eventDate == "02/11/2018"): print(febElevenArry) if (eventDate == "02/12/2018"): print(febTwelveArry) if (eventDate == "02/13/2018"): print(febThirteenArry) # Date variables with event information strings febTenArry = [ "Krewe of Iris Uptown 1000am", "Krewe of Tucks Uptown 1100am", "Krewe of NOMTOC Westbank 1045am", "Krewe of Endymnion Midtown 415pm", "Krewe of Isis Metairie 630pm" ] febElevenArry = [ "Krewe of Okeanos Uptown 11:00am", "Krewe of Mid-City Uptown 11:45am", "Krewe of Thoth Uptown 12:00pm", "Krewe of Bacchus Uptown 5:15pm", "Corps de Napoleon Metairie 5:00pm", "Krewe of Athena Metairie 5:30pm", "Krewe of Pandora Metairie 6:30pm" ] febTwelveArry = [ "Krewe of Proteus Uptown 5:15pm", "Krewe of Orpheus Uptown 6:00pm" ] febThirteenArry = [ "Krewe of Zulu Uptown 8:00am", "Krewe of Rex Uptown 10:00am", "Krewe of Elks Orleans Uptown 12:00pm", "Krewe of Crescent City Uptown 2:00pm", "Krewe of Argus Metairie 10:00am", "Krewe of Elks Jefferson Metairie 12:00pm", "Krewe of Jefferson Metairie 2:00pm", "Krewe of Lyra Covington 10:00am" ] #opt function called opt() #while loop to allow user to enter dates multiple times before closing while input != "exit": opt() #End of Application
Output:Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
Madi Gras Event Schedule
Dates: 02/10/2018 - 02/13/2018
Format Example mm/dd/yyyy
Please select a date 02/13/2018
['Krewe of Zulu\tUptown 8:00am', 'Krewe of Rex\tUptown 10:00am', 'Krewe of Elks Orleans\tUptown 12:00pm', 'Krewe of Crescent City\tUptown 2:00pm', 'Krewe of Argus\tMetairie 10:00am', 'Krewe of Elks Jefferson\tMetairie 12:00pm', 'Krewe of Jefferson\tMetairie 2:00pm', 'Krewe of Lyra\tCovington 10:00am']
Please select a date