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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
#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