Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 1.62 KB

File metadata and controls

77 lines (53 loc) · 1.62 KB

Happy Hour Challenge

Default code

import random

bars = ["Shoolbred's",
        "The Wren",
        "The Scratcher",
        "ACME",
        "Blind Barber"]

people = ["Mattan",
          "Chris",
          "that person you forgot to text back",
          "Kanye West",
          "Samule L. Jackson"]

random_bar = random.choice(bars)
random_person = random.choice(people)


print(f"How about you go to {random_bar} with {random_person}?")

Step by Step Explanation

  1. Top of the file
import random

This imports other code. A library called 'random' that later allows us to pick out a random bar or random person from our lists.

  1. Lists of Bars & People
bars = ["Shoolbred's",
        "The Wren",
        "The Scratcher",
        "ACME",
        "Blind Barber"]

people = ["Mattan",
          "Chris",
          "that person you forgot to text back",
          "Kanye West",
          "Samule L. Jackson"]

These are lists of bars and people. They are going to be pulled into...

  1. Pick a random bar and a random person
random_bar = random.choice(bars)
random_person = random.choice(people)

This is where our script picks a random bar and a random person.

  1. Print out the results
print(f"How about you go to {random_bar} with {random_person_one} 

This line prints out the random bar and random person.

The Happy Hour Challenge is

  • I misspelled Samuel L Jackson's name. Fix the typo.
  • Add another person to the list of people.
  • Change the script so it prints out two random people instead of one. (ex. How about you go to Lion's Head Tavern with Mattan and Chris?)