Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions ch_1_assign_kathy_li.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#This is the dictionary that stores all the information about the teams.
teams_info = {
1678 : {
'location': 'Davis, California, USA',
'rookie year': 2005,
'competed in 2019?': True,
'2019 competitions': [
'Central Valley Regional (Fresno, California, USA)',
'Sacramento Regional (Davis, California, USA)',
'Aerospace Valley (Lancaster, California, USA)',
'Carver Division - Houston Championship (Houston, Texas, USA)',
'Einstein Field - Houston Championship (Houston, Texas, USA)',
'RCC Qianjiang International Robotics Invitational (Hangzhou, Zhejiang, China)',
'Chezy Champs (San Jose, California, USA)',
],
'2019 season awards': [
'Chairman\'s Award, Central Valley Regional',
'Winner, 2019 Central Valley Regional',
'FIRST Dean\'s List Finalist Award, Sacramento Regional (Katie Stachowicz)',
'Industrial Design Award (sponsored by General Motors), Sacramento Regional',
'Winner, 2019 Sacramento Regional',
'Excellence in Engineering Award (sponsored by Delphi), Aerospace Valley Regional',
'Winner, 2019 Aerospace Valley Regional',
'Entrepreneurship Award (sponsored by Kleiner Perkins Caufield and Byers)',
'Winner, 2019 Carver Division - Houston Championship',
]
},
1868 : {
'location': 'Mountain View, California, USA',
'rookie year': 2006,
'competed in 2019?': True,
'2019 competitions': [
'Los Angeles North Regional (Valencia, California, USA)',
'Silicon Valley Regional (San Jose, California, USA)',
'Turing Division - Houston Championship (Houston, TX)',
'Chezy Champs (San Jose, California, USA)',
],
'2019 season awards': [
'Chairman\'s Award, Los Angeles North Regional',
'Winner, 2019 Los Angeles North Regional',
'Entrepreneurship Award (sponsored by Kleiner Perkins Caufield and Byers), Silicon Valley Regional',
]
},
1323 : {
'location': 'Madera, California, USA',
'rookie year': 2004,
'competed in 2019?': True,
'2019 competitions': [
'Central Valley Regional (Fresno, California, USA)',
'Sacramento Regional (Davis, California, USA)',
'Newton Division - Houston Championship (Houston, Texas, USA)',
'Einstein Field (Houston, Texas, USA)',
],
'2019 season awards': [
'Autonomous Award (sponsored by Ford), Central Valley Regional',
'Winner, 2019 Central Valley Regional',
'Quality Award sponsored by Motorola Solutions Foundation',
'Winner, 2019 Sacramento Regional',
'Industrial Design Award (sponsored by General Motors), Houston Championship '
'Winner, 2019 Newton Division - Houston Championship',
'Winner, 2019 Houston Championship',
]
},
3132 : {
'location': 'Sydney, Australia',
'rookie year': 2010,
'competed in 2019?': True,
'2019 competitions': [
'Southern Cross Regional (Sydney, Australia)',
'South Pacific Regional (Sydney, Australia)',
'Carver Division - Houston Championship (Houston, Texas, USA)',
'Einstein Field - Houston Championship (Houston, Texas, USA)',
'Duel Down Under (Sydney, Australia)',
],
'2019 season awards': [
'Woodie Flowers Finalist Award, Southern Cross Regional (Sarah Heimlich)',
'Gracious Professionalism Award (sponsored by Johnson & Johnson), Southern Cross Regional',
'Regional Engineering Inspiration Award, South Pacific Regional',
'FIRST Dean\'s List Finalist Award, South Pacific Regional (Jaye Heimlich)',
'Safety Award (sponsored by Underwriters Laboratories), South Pacific Regional',
'Winner, 2019 Carver Division - Houston Championship',
]
},
254 : {
'location': 'San Jose, California, USA',
'rookie year': 1999,
'competed in 2019?': True,
'2019 competitions': [
'San Francisco Regional (San Francisco, California, USA)',
'Silicon Valley Regional (San Jose, California, USA)',
'Turing Division - Houston Championship (Houston, Texas, USA)',
'Einstein Field - Houston Championship (Houston, Texas, USA)',
'Chezy Champs (San Jose, California, USA)'
],
'2019 season awards': [
'Innovation in Control Award (sponsored by Rockwell Automation), San Francisco Regional',
'Winner, 2019 San Francisco Regional',
'Excellence in Engineering Award (sponsored by Delphi), Silicon Valley Regional',
'Winner, 2019 Silicon Valley Regional',
'Industrial Design Award (sponsored by General Motors), Turing Divions'
'Winner, 2019 Turing Division - Houston Championship',
'Championship Finalist, Einstein Field - Houston Championship',

]
},
}
team_input = int(input('Choose an FRC team: 1678, 1868, 1323, 3132, or 254.\n'))
team_attribute = str(input('Enter an attribute: "Location", "Rookie Year", "Competed in 2019?", "2019 Competitions", and "2019 Season Awards".\n').lower())
#without .lower(), user input is case-sensitive.
print(teams_info[team_input][team_attribute])
1 change: 1 addition & 0 deletions ch_1_lesson_{Kathy}_{Li}.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('Hello, world!')
82 changes: 82 additions & 0 deletions ch_2_assign_kathy_li.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
teams = {}
user_action = input("Welcome to the Menu. Please select an action: add, remove, modify, view team information, search, or list. To quit, enter quit.")
while True:

if user_action == "list":
print(teams)
return

elif user_action == "remove":
delete_team_input = int(input("Which team would you like to remove? Enter 0 to return to the main menu."))
if delete_team_input == "0":
return
elif delete_team_input in teams.keys():
teams.pop(delete_team_input)
print("Team " + delete_team_input + " has been removed.")
else:
print("Team " + delete_team_input " has not been found. Returning to main menu...")
return

# elif user_action == "modify":
# update_team_input = input("which team would you like to modify?")
# if update_team_input in teams.keys():
# print(teams[update_team_input])
# area_of_update_team = input("Which area of the team would you like to update?")

#This below chunk of code is error message debugger code that I haven't finished yet.

# if area_of_update_team in ["new_team", "new_team_robot_width", "new_team_robot_length", "new_team_drivetrain_motors"]:
# update_value = input("New value: ")
# if not area_of_update_team.isnumeric():
# print("Input is not valid.")
# elif area_of_update_team == "new_team_camera_vision":
# if value.lower() != "yes" and value.lower() != "no":
#
#
#
# else:
# teams[update_team_input][area_of_update_team] = value
# print("The team has been updated.")


elif user_action == "add":
new_team = int(input("Enter the number of the team you want to add."))
teams[new_team] = {}
new_team_name = input("What is the team's name?")
teams[new_team]["name"] = new_team_name
new_team_programming_language = input("What programming language does the team use?")
teams[new_team]["programming language"] = new_team_programming_language
new_team_robot_width = input("What is the width of the team's robot?")
teams[new_team_name]["width of robot"] = new_team_robot_width
new_team_robot_length = int(input("What is the length of the team's robot?"))
teams[new_team_name]["length of robot"] = new_team_robot_length
new_team_camera_vision = int(input("Does the team have a camera vision system?"))
teams[new_team_name]["camera vision"] = new_team_camera_vision
new_team_number_of_drivetrain_motors = input("How many drivetrain motors does the robot have?")
teams[new_team]["number of drivetrain motors"] = new_team_number_of_drivetrain_motors
print("Returning to main menu...")
return

elif user_action == "view team information":
view_team_input = input("Which team's information would you like to view? To return to the menu, press 0.")
if view_team_input == "0":
return
elif view_team_input in teams():
print(teams[view_team_input])
else:
print("Team" + view_team_input + " has not been found. Returning to main menu...")
return

elif user_action == "search":
search_team_input = input("Which team would you like to search for? To return to the main menu, enter 0.")
if search_team_input in teams.keys():
print(teams[search_team_input])
else
print("Team does not exist. Returning to main menu...")
break

elif user_action == "quit":
break
#To not receive an error message in the add function, could I define each variable seperately and make an if/else/elif statement?
#Can I loop the code instead of making it return to the main menu?
#Have not tested entire code/done validation yet.