Skip to content

You'll be introduced to Python syntax, how to store data in variables as well as how to print out information to the screen.

License

Notifications You must be signed in to change notification settings

s-shemmee/Happy-Hour-Challenge-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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?)

About

You'll be introduced to Python syntax, how to store data in variables as well as how to print out information to the screen.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages