0% found this document useful (0 votes)
115 views

Create Performance Task

The document describes a Python program that functions as a TV guide. It asks the user to input a network and prints the channel and lineup for that network. The program uses variables to define networks, if/elif/else statements to check the user input, and lists to store the lineup for each network. One challenge was the program printing "None" - this was fixed by changing a print statement to a return statement. Functions are defined for each network that print the channel and return the lineup. Lists store the lineup information for each network. Together these algorithms allow the program to output the network, channel, and lineup when the user inputs a network.

Uploaded by

api-449934330
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views

Create Performance Task

The document describes a Python program that functions as a TV guide. It asks the user to input a network and prints the channel and lineup for that network. The program uses variables to define networks, if/elif/else statements to check the user input, and lists to store the lineup for each network. One challenge was the program printing "None" - this was fixed by changing a print statement to a return statement. Functions are defined for each network that print the channel and return the lineup. Lists store the lineup information for each network. Together these algorithms allow the program to output the network, channel, and lineup when the user inputs a network.

Uploaded by

api-449934330
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Create Performance Task March 29, 2019

TV Guide

2a) The program that I have coded operates as a tv guide. My program is written in Python. The purpose
of my program is to get user input and then print an output based off the input provided. My program
asks the user what network they would like to watch. The user will type in the network of their choice
and if the network is available, my program will print the network channel and the lineup for that
network. If the user types in a network that is not available, my program will print “That network is not
available.”

2b) The incremental processes within my code are assigning variables to the networks, defining each
network so that it prints a specific output, creating if/elif/else statements to correspond with user input,
and creating lists(lineups) that will be assigned to each network. One of the difficulties I encountered
was when my code executed my output included a print out of the word “None”. I figured out that the
reason for this was because I included two print statements within my variable definitions. So, to fix the
“None” problem I changed one of my print statements to a return statement. Doing so, helped get rid of
my code printing “None” at the end of my output. This development was independent.

2c) #DEFINE FUNCTION FOR NETWORK CHANNEL


def BET():

print network_1 + " is on channel 124."

return bet_lineup

def HBO():

print network_2 + " is on channel 87."

return hbo_lineup

def NBC():

print network_3 + " is on channel 24."

return nbc_lineup

def FOX():

print network_4 + " is on channel 5."

return fox_lineup

def ABC():

print network_5 + " is on channel 12."

return abc_lineup

def CartoonNetwork():

print network_6 + " is on channel 36."

return cartoon_lineup
def DisneyChannel():

print network_7 + " is on channel 64."

return disney_lineup

This algorithm was created independently. My algorithm uses variables, printing, functions, lists, and
strings. This algorithm is the most important part of my code because this allows for an output to be
produced. When the user provides the network of their choice, the algorithm prints the definition of
that network. My print statement within my algorithm concatenates a variable(string) with an actual
string statement. After the print function, my algorithm will find the lineup for a specific network. It will
then return the list created for that network lineup. All my algorithms work together to produce the
network and channel it comes on, along with the lineup for a specific time.

2d) #ASSIGN THE VARIABLES FOR NETWORK CHANNEL LINEUP


bet_lineup = ["1:00pm: House of Payne", "1:30pm: House of Payne", "2:00pm: Meet the Browns", "2:30pm:
Meet the Browns", "3:00pm: Baby Boy"]

hbo_lineup = ["1:00pm: Game of Thrones", "2:00pm: True Detective", "3:00pm: Sex and the City", "4:00pm:
True Blood"]

nbc_lineup = ["1:00pm: The Good Place", "2:00pm: Manifest", "3:00pm: New Amsterdam", "4:00: This is Us"]

fox_lineup = ["1:00pm: The Gifted", "2:00pm: Lethal Weapon", "3:00pm: Rel", "4:00pm: Empire"]

abc_lineup = ["1:00pm: Grey's Anatomy", "2:00pm: Grey's Anatomy", "3:00pm: The Good Doctor", "4:00pm:
Dancing with the Stars"]

cartoon_lineup = ["1:00pm: Steven Universe", "1:30pm: Steven Universe", "2:00pm: Adventure Time", "2:30pm:
The Amazing World of Gumball", "3:00pm: The Amazing World of Gumball", "3:30pm: Teen Titans Go!",
"4:00pm: Teen Titans Go!"]

disney_lineup = ["1:00pm: Raven's Home", "1:30pm: Phineas and Ferb", "2:00pm: Hannah Montana", "2:30pm:
Wizards of Waverly Place", "3:00pm: Wizards of Waverly Place", "3:30pm: Girl Meets World", "4:00pm: Girl
Meets World"]

This is an abstraction pulled directly from my code. My abstraction is in the form of lists. I used lists to
allow myself to print out multiple show outlines at one time without having to do each show
individually. This allowed me to manage the complexity of my code. Creating a list was quicker and
made my code more efficient when running.

You might also like