From d2b82722871d9f4bc2077c4c1ca407af8b77792b Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 11 Sep 2019 20:05:46 -0700 Subject: [PATCH 1/4] add Hello World --- ch_1_lesson_{Kathy}_{Li}.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 ch_1_lesson_{Kathy}_{Li}.py diff --git a/ch_1_lesson_{Kathy}_{Li}.py b/ch_1_lesson_{Kathy}_{Li}.py new file mode 100644 index 0000000..8c854ae --- /dev/null +++ b/ch_1_lesson_{Kathy}_{Li}.py @@ -0,0 +1 @@ +print('Hello, world!') \ No newline at end of file From 34049b2925d170b9690a5cef6d88f128cad007dd Mon Sep 17 00:00:00 2001 From: Kathy Date: Sun, 15 Sep 2019 20:27:15 -0700 Subject: [PATCH 2/4] ch_1_assign_kathy_li.py --- ch_1_assign_kathy_li.py | 110 ++++++++++++++++++++++++++++++++++++++++ sghwassignment1.py | 1 + 2 files changed, 111 insertions(+) create mode 100644 ch_1_assign_kathy_li.py create mode 100644 sghwassignment1.py diff --git a/ch_1_assign_kathy_li.py b/ch_1_assign_kathy_li.py new file mode 100644 index 0000000..e0ba45d --- /dev/null +++ b/ch_1_assign_kathy_li.py @@ -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]) \ No newline at end of file diff --git a/sghwassignment1.py b/sghwassignment1.py new file mode 100644 index 0000000..edc3e59 --- /dev/null +++ b/sghwassignment1.py @@ -0,0 +1 @@ +teams_and_robots = {team_1678 = {'weight':'167','wheels':'hexagonal','length':'20','width':'9','color':'neon yellow'}} \ No newline at end of file From 6701a397072c953c628c9628934973b92cb56331 Mon Sep 17 00:00:00 2001 From: Kathy Date: Sun, 15 Sep 2019 20:32:31 -0700 Subject: [PATCH 3/4] ch_1_assign_kathy_li.py --- sghwassignment1.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 sghwassignment1.py diff --git a/sghwassignment1.py b/sghwassignment1.py deleted file mode 100644 index edc3e59..0000000 --- a/sghwassignment1.py +++ /dev/null @@ -1 +0,0 @@ -teams_and_robots = {team_1678 = {'weight':'167','wheels':'hexagonal','length':'20','width':'9','color':'neon yellow'}} \ No newline at end of file From 9c37602636f3b99de2cb3eceb6b2312869798732 Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 2 Oct 2019 16:45:22 -0700 Subject: [PATCH 4/4] Add existing file --- ch_2_assign_kathy_li.py | 82 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 ch_2_assign_kathy_li.py diff --git a/ch_2_assign_kathy_li.py b/ch_2_assign_kathy_li.py new file mode 100644 index 0000000..0e30bb9 --- /dev/null +++ b/ch_2_assign_kathy_li.py @@ -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. \ No newline at end of file