Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This brings in the timing machinism that helps time out the printing.
- import time
- #Prints out an introduction
- print ("I love lists, don't you?'")
- #Names the list and what contents are in the list.
- list = ["Apples", "Oranges", "Broccoli"]
- #Prints the list.
- print (list)
- #Prints the Names of anything in list that starts with the letter "B".
- BList = [title for title in list if title.startswith("B")]
- #Prints the list in time.
- print ("Here it comes.")
- time.sleep (0.5) # Here's the amount of time it waits.
- print (".")
- time.sleep (0.5)
- print (".")
- time.sleep (0.5)
- print (".")
- time.sleep (1)
- #Prints the item in list that starts with "B"!
- print (BList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement