From 425728480669067255b3cebf54223b7bfb6e36d7 Mon Sep 17 00:00:00 2001 From: 1678 Scouting <1678scouting@1678s-MacBook-Pro.local> Date: Wed, 11 Sep 2019 19:39:43 -0700 Subject: [PATCH 01/23] Initial commit Adding Helloworld.py --- Helloworld.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 Helloworld.py diff --git a/Helloworld.py b/Helloworld.py new file mode 100644 index 0000000..44159b3 --- /dev/null +++ b/Helloworld.py @@ -0,0 +1 @@ +print("Hello world") From fc6bfab553b54485d843b3835e1c4cf1942d1e8f Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 11 Sep 2019 20:48:36 -0700 Subject: [PATCH 02/23] This is my homework assignment --- Homework#1.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Homework#1.py diff --git a/Homework#1.py b/Homework#1.py new file mode 100644 index 0000000..d7bd4df --- /dev/null +++ b/Homework#1.py @@ -0,0 +1,2 @@ +Robots={'1678':{'Weight':'100','Height':'150','Length':'200'}'127':{'Weight':'250','Height':'300','Length':'350'}} +print(Robots['1678']['Weight']) \ No newline at end of file From b18d7ea629629d2ed4f61fd76fb5ce840c1b2752 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 12 Sep 2019 20:46:54 -0700 Subject: [PATCH 03/23] Add program to file --- ch-1_assign_lucca_braudagan.py | 75 ++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 ch-1_assign_lucca_braudagan.py diff --git a/ch-1_assign_lucca_braudagan.py b/ch-1_assign_lucca_braudagan.py new file mode 100644 index 0000000..22e74e9 --- /dev/null +++ b/ch-1_assign_lucca_braudagan.py @@ -0,0 +1,75 @@ +teams={ + "1678_citrus_circuits":{ + "location":"Davis, CA", + "rookie_year":2005, + "competed_in_2019_seaseon":True, + "2019_competition_names":[ + "Central_Valley_Regional", + "Sacramento_Regional", + "Aerospace_Valley_Regional", + "Carver_Division", + "Einstein_Field", + "RCC_Qianjiang_International_Robotics_Invitational", + "Chezy_Champs"], + "2019_competition_locations":[ + "Fresno_CA", + "Davis_CA", + "Lancaster_CA", + "Houston_TX", + "Houston_TX_Again" + "Hangzhou_Zhejiang_China", + "San_Jose"], + "2019_season_awards":[ + "Chairman's_Award_At_Central_Valley_Regional", + "Winner_At_Central_Valley_Regional", + "Winner_At_Sacramento_Regional", + "Winner_At_Aerospace_Valley_Regional", + "Winner_At_Carver_Divison"] + }, + "4322_clockwork_oranges":{ + "location":"Orange, CA", + "rookie_year":2012, + "competed_in_2019_seaseon":True, + "2019_competition_names":[ + "San_Diego_Regional_Presented_By_Qualcomm", + "Las_Vegas_Regional", + "Einstein_Field", + "Battleship_Blast_Monday", + "Beach_Blitz"], + "2019_competition_locations":[ + "Del_Mar_CA", + "Las_Vegas_NV", + "Houston_TX", + "San_Pedro_CA", + "Huntington_Beach_CA"], + "2019_season_awards":"None" + }, + "5458_digital_minds":{ + "location":"Woodland, CA", + "rookie_year":2015, + "competed_in_2019_seaseon":True, + "2019_competition_names":[ + "Central_Valley_Regional", + "Sacramento_Regional"], + "2019_competition_locations":[ + "Fresno_CA", + "Davis_CA"], + "2019_season_awards":"None" + } + "1_the_juggernauts":{ + "location":"Pontiac, MI", + "rookie_year":1997, + "competed_in_2019_seaseon":True, + "2019_competition_names":[ + "FIM_District_Center_Line_Event", + "FIM_District_Troy_Event"] + "2019_competition_locations":[ + "Center_Line_MI", + "Troy_MI"] + "2019_season_awards":"None" + } + "7229" +} +team_number=input("Team:") +team_information=input("Category:") +print(teams[team_number][team_information]) \ No newline at end of file From 5c8cbcf0570cdaf90ef4b37309a391126944c216 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Sun, 15 Sep 2019 19:44:57 -0700 Subject: [PATCH 04/23] Add program to file --- ch-1_assign_lucca_braudagan.py | 46 +++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/ch-1_assign_lucca_braudagan.py b/ch-1_assign_lucca_braudagan.py index 22e74e9..184d6e3 100644 --- a/ch-1_assign_lucca_braudagan.py +++ b/ch-1_assign_lucca_braudagan.py @@ -1,5 +1,6 @@ teams={ - "1678_citrus_circuits":{ + "1678":{ + "team_name":"Citrus Circuits", "location":"Davis, CA", "rookie_year":2005, "competed_in_2019_seaseon":True, @@ -20,13 +21,18 @@ "Hangzhou_Zhejiang_China", "San_Jose"], "2019_season_awards":[ - "Chairman's_Award_At_Central_Valley_Regional", - "Winner_At_Central_Valley_Regional", - "Winner_At_Sacramento_Regional", - "Winner_At_Aerospace_Valley_Regional", - "Winner_At_Carver_Divison"] + "Regional_Chairman's_Award_At_Central_Valley_Regional", + "Regional_Winners_At_Central_Valley_Regional", + "FIRST_Dean's_List_Finalist_Award", + "Regional_Winners_At_Sacramento_Regional", + "Industrial_Design_Award_Sponsored_By_General_Motors", + "Regional_Winners_At_Aerospace_Valley_Regional", + "Excellence_In_Engineering_Award_Sponsered_By_Delphi", + "Championship_Subdivision_Winner_In_Carver_Divison", + "Entrepreneurship_Award_Sponsored_By_Kleiner_Perkins_Caufield_And_Byers"] }, - "4322_clockwork_oranges":{ + "4322":{ + "team_name":"Clockwork Oranges", "location":"Orange, CA", "rookie_year":2012, "competed_in_2019_seaseon":True, @@ -42,9 +48,12 @@ "Houston_TX", "San_Pedro_CA", "Huntington_Beach_CA"], - "2019_season_awards":"None" + "2019_season_awards":[ + "FIRST_Dean's_List_Finalist_Award", + "FIRST_Dean's_List_Award"] }, - "5458_digital_minds":{ + "5458":{ + "team_name":"Digital Minds", "location":"Woodland, CA", "rookie_year":2015, "competed_in_2019_seaseon":True, @@ -55,20 +64,29 @@ "Fresno_CA", "Davis_CA"], "2019_season_awards":"None" - } - "1_the_juggernauts":{ + }, + "1":{ + "team_name":"The Juggernauts", "location":"Pontiac, MI", "rookie_year":1997, "competed_in_2019_seaseon":True, "2019_competition_names":[ "FIM_District_Center_Line_Event", - "FIM_District_Troy_Event"] + "FIM_District_Troy_Event"], "2019_competition_locations":[ "Center_Line_MI", - "Troy_MI"] + "Troy_MI"], + "2019_season_awards":"Imagery_Award_In_Honor_Of_Jack_Kamen" + }, + "7229":{ + "team_name":"Electronic Eagles", + "location":"Sacramento, CA", + "rookie_year":2018, + "competed_in_2019_seaseon":True, + "2019_competition_names":"Sacramento_Regional", + "2019_competition_locations":"Davis_CA", "2019_season_awards":"None" } - "7229" } team_number=input("Team:") team_information=input("Category:") From 29a76819eb7ebf77e92864e22a4f2febc748ec64 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 19 Sep 2019 20:53:04 -0700 Subject: [PATCH 05/23] Initial pit scout code --- ch_2_assign_lucca_braudagan.py | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ch_2_assign_lucca_braudagan.py diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py new file mode 100644 index 0000000..4f1d926 --- /dev/null +++ b/ch_2_assign_lucca_braudagan.py @@ -0,0 +1,37 @@ +teams = {} + +initial_user_request = input("choose_from:_'add',_'view',_'modify',_'remove',_'search',_'list',_'return'") +if initial_user_request=="add": + add_team(); +elif initial_user_request=="view": + +elif initial_user_request=="modify": + +elif initial_user_request=="remove": + +elif initial_user_request=="search": + +elif initial_user_request=="list": + +elif initial_user_request=="return": + +else initial_user_request!="add","view","modify","remove","search","list","return": + +def add_team(): + temp_team_dictionary = {} + + name = input("What is your team's name?") + p_language = input("What is your team's programming language?") + + temp_team_dictionary["name"] = name + temp_team_dictionary["p_l"] = p_language + + team_number = input("What is your team's 'team number'") + teams[team_number] = temp_team_dictionary + +add_team() citrus circuits, c++, 1678 + +#{1678 : {"name" : "citrus circuits", "p_l" : "c++"}} + + + From f45eba0ffd3a12cafa18d31c110752ed5d305ebd Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 19 Sep 2019 20:55:57 -0700 Subject: [PATCH 06/23] pt 2 --- ch_2_assign_lucca_braudagan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py index 4f1d926..6d6e724 100644 --- a/ch_2_assign_lucca_braudagan.py +++ b/ch_2_assign_lucca_braudagan.py @@ -32,6 +32,6 @@ def add_team(): add_team() citrus circuits, c++, 1678 #{1678 : {"name" : "citrus circuits", "p_l" : "c++"}} - + From 2bc1220f928c4f64e7c0f16b672e45a08822d9b1 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 25 Sep 2019 19:25:08 -0700 Subject: [PATCH 07/23] Improved structure --- ch-1_assign_lucca_braudagan.py | 116 ++++++++++++++++----------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/ch-1_assign_lucca_braudagan.py b/ch-1_assign_lucca_braudagan.py index 184d6e3..550a576 100644 --- a/ch-1_assign_lucca_braudagan.py +++ b/ch-1_assign_lucca_braudagan.py @@ -1,93 +1,93 @@ teams={ - "1678":{ + 1678:{ "team_name":"Citrus Circuits", "location":"Davis, CA", "rookie_year":2005, - "competed_in_2019_seaseon":True, + "competed_in_2019_season":True, "2019_competition_names":[ - "Central_Valley_Regional", - "Sacramento_Regional", - "Aerospace_Valley_Regional", - "Carver_Division", - "Einstein_Field", - "RCC_Qianjiang_International_Robotics_Invitational", - "Chezy_Champs"], + "Central Valley Regional", + "Sacramento Regional", + "Aerospace Valley Regional", + "Carver Division", + "Einstein Field", + "RCC Qianjiang International Robotics Invitational", + "Chezy Champs"], "2019_competition_locations":[ - "Fresno_CA", - "Davis_CA", - "Lancaster_CA", - "Houston_TX", - "Houston_TX_Again" - "Hangzhou_Zhejiang_China", - "San_Jose"], + "Fresno, CA", + "Davis, CA", + "Lancaster, CA", + "Houston, TX", + "Houston, TX, Again" + "Hangzhou, Zhejiang, China", + "San Jose, CA"], "2019_season_awards":[ - "Regional_Chairman's_Award_At_Central_Valley_Regional", - "Regional_Winners_At_Central_Valley_Regional", - "FIRST_Dean's_List_Finalist_Award", - "Regional_Winners_At_Sacramento_Regional", - "Industrial_Design_Award_Sponsored_By_General_Motors", - "Regional_Winners_At_Aerospace_Valley_Regional", - "Excellence_In_Engineering_Award_Sponsered_By_Delphi", - "Championship_Subdivision_Winner_In_Carver_Divison", - "Entrepreneurship_Award_Sponsored_By_Kleiner_Perkins_Caufield_And_Byers"] + "Regional Chairman's Award At Central Valley Regional", + "Regional Winners At Central Valley Regional", + "FIRST Dean's List Finalist Award", + "Regional Winners At Sacramento Regional", + "Industrial Design Award Sponsored By General Motors", + "Regional Winners At Aerospace Valley Regional", + "Excellence In Engineering Award Sponsered By Delphi", + "Championship Subdivision Winner In Carver Divison", + "Entrepreneurship Award Sponsored By Kleiner Perkins Caufield And Byers"] }, - "4322":{ + 4322:{ "team_name":"Clockwork Oranges", "location":"Orange, CA", "rookie_year":2012, - "competed_in_2019_seaseon":True, + "competed_in_2019_season":True, "2019_competition_names":[ - "San_Diego_Regional_Presented_By_Qualcomm", - "Las_Vegas_Regional", - "Einstein_Field", - "Battleship_Blast_Monday", - "Beach_Blitz"], + "San Diego Regional Presented By Qualcomm", + "Las Vegas Regional", + "Einstein Field", + "Battleship Blast Monday", + "Beach Blitz"], "2019_competition_locations":[ - "Del_Mar_CA", - "Las_Vegas_NV", - "Houston_TX", - "San_Pedro_CA", - "Huntington_Beach_CA"], + "Del Mar, CA", + "Las Vegas, NV", + "Houston, TX", + "San Pedro, CA", + "Huntington Beach, CA"], "2019_season_awards":[ - "FIRST_Dean's_List_Finalist_Award", - "FIRST_Dean's_List_Award"] + "FIRST Dean's List Finalist Award", + "FIRST Dean's List Award"] }, - "5458":{ + 5458:{ "team_name":"Digital Minds", "location":"Woodland, CA", "rookie_year":2015, - "competed_in_2019_seaseon":True, + "competed_in_2019_season":True, "2019_competition_names":[ - "Central_Valley_Regional", - "Sacramento_Regional"], + "Central Valley Regional", + "Sacramento Regional"], "2019_competition_locations":[ - "Fresno_CA", - "Davis_CA"], + "Fresno, CA", + "Davis, CA"], "2019_season_awards":"None" }, - "1":{ + 1:{ "team_name":"The Juggernauts", "location":"Pontiac, MI", "rookie_year":1997, - "competed_in_2019_seaseon":True, + "competed_in_2019_season":True, "2019_competition_names":[ - "FIM_District_Center_Line_Event", - "FIM_District_Troy_Event"], + "FIM District Center Line Event", + "FIM District Troy Event"], "2019_competition_locations":[ - "Center_Line_MI", - "Troy_MI"], - "2019_season_awards":"Imagery_Award_In_Honor_Of_Jack_Kamen" + "Center Line, MI", + "Troy, MI"], + "2019_season_awards":"Imagery Award In Honor Of Jack Kamen" }, - "7229":{ + 7229:{ "team_name":"Electronic Eagles", "location":"Sacramento, CA", "rookie_year":2018, - "competed_in_2019_seaseon":True, - "2019_competition_names":"Sacramento_Regional", - "2019_competition_locations":"Davis_CA", + "competed_in_2019_season":True, + "2019_competition_names":"Sacramento Regional", + "2019_competition_locations":"Davis, CA", "2019_season_awards":"None" } } -team_number=input("Team:") -team_information=input("Category:") +team_number=int(input("Team Number (options are '1', '1678', '4322', '5458', '7229'):")) +team_information=input("Category (options are 'team_name', 'location', 'rookie_year', 'competed_in_2019_season','2019_competition_names', '2019_competition_locations', '2019_season_awards':") print(teams[team_number][team_information]) \ No newline at end of file From a1ed0324ccf17bd869d513fe9df39c0019404183 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 25 Sep 2019 20:48:10 -0700 Subject: [PATCH 08/23] Initial code for ch2 assignment --- ch_2_assign_lucca_braudagan.py | 62 ++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py index 6d6e724..7c8a1dc 100644 --- a/ch_2_assign_lucca_braudagan.py +++ b/ch_2_assign_lucca_braudagan.py @@ -1,35 +1,47 @@ teams = {} -initial_user_request = input("choose_from:_'add',_'view',_'modify',_'remove',_'search',_'list',_'return'") -if initial_user_request=="add": - add_team(); -elif initial_user_request=="view": - -elif initial_user_request=="modify": - -elif initial_user_request=="remove": - -elif initial_user_request=="search": - -elif initial_user_request=="list": - -elif initial_user_request=="return": - -else initial_user_request!="add","view","modify","remove","search","list","return": - def add_team(): temp_team_dictionary = {} - name = input("What is your team's name?") - p_language = input("What is your team's programming language?") - - temp_team_dictionary["name"] = name - temp_team_dictionary["p_l"] = p_language - - team_number = input("What is your team's 'team number'") + team_number = input("What is your team's team number?") + team_name = input("What is your team's name?") + robot_name = input("What is your robot's name?") + robot_p_language = input("What is your robot's programming language?") + robot_width = input("What is your robot's width?") + robot_height = input("What is your robot's height?") + robot_camera = input("Does your robot have a camera vision system?") + robot_drivetrain = input("How many drivetrain motors does your robot have?") + + temp_team_dictionary["team_name"] = team_name + temp_team_dictionary["robot_name"] = robot_name + temp_team_dictionary["robot_p_language"] = robot_p_language + temp_team_dictionary["robot_width"] = robot_width + temp_team_dictionary["robot_height"] = robot_height + temp_team_dictionary["robot_camera"] = robot_camera + temp_team_dictionary["robot_drivetrain"] = robot_drivetrain + teams[team_number] = temp_team_dictionary -add_team() citrus circuits, c++, 1678 +initial_user_request = input("choose_from:_'add',_'view',_'modify',_'remove',_'search',_'list',_'return'") +if initial_user_request == "add": + add_team(); +elif initial_user_request == "view": + print("Nothing"), +elif initial_user_request == "modify": + print("Nothing"), +elif initial_user_request == "remove": + print("Nothing"), +elif initial_user_request == "search": + print("Nothing"), +elif initial_user_request == "list": + print("Nothing"), +elif initial_user_request == "return": + print("Nothing"), +else: + print("Nothing"), + + +#add_team() citrus circuits, c++, 1678 #{1678 : {"name" : "citrus circuits", "p_l" : "c++"}} From ad480eae22e2d00e986053f7895b24111bd5884f Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 26 Sep 2019 19:35:33 -0700 Subject: [PATCH 09/23] Make dictionaries for competitions --- ch-1_assign_lucca_braudagan.py | 133 +++++++++++++++------------------ 1 file changed, 59 insertions(+), 74 deletions(-) diff --git a/ch-1_assign_lucca_braudagan.py b/ch-1_assign_lucca_braudagan.py index 550a576..08f913a 100644 --- a/ch-1_assign_lucca_braudagan.py +++ b/ch-1_assign_lucca_braudagan.py @@ -1,26 +1,19 @@ -teams={ - 1678:{ - "team_name":"Citrus Circuits", - "location":"Davis, CA", - "rookie_year":2005, - "competed_in_2019_season":True, - "2019_competition_names":[ - "Central Valley Regional", - "Sacramento Regional", - "Aerospace Valley Regional", - "Carver Division", - "Einstein Field", - "RCC Qianjiang International Robotics Invitational", - "Chezy Champs"], - "2019_competition_locations":[ - "Fresno, CA", - "Davis, CA", - "Lancaster, CA", - "Houston, TX", - "Houston, TX, Again" - "Hangzhou, Zhejiang, China", - "San Jose, CA"], - "2019_season_awards":[ +teams = { + 1678 : { + "team_name" : "Citrus Circuits", + "location" : "Davis, CA", + "rookie_year" : 2005, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Central Valley Regional" : "Fresno, CA", + "Sacramento Regional" : "Davis, CA", + "Aerospace Valley Regional" : "Lancaster, CA", + "Carver Division" : "Houston, TX", + "Einstein Field" : "Houston, TX", + "RCC Qianjiang International Robotics Invitational" : "Hangzhou, Zhejiang, China", + "Chezy Champs" : "San Jose, CA" + }, + "2019_season_awards" : [ "Regional Chairman's Award At Central Valley Regional", "Regional Winners At Central Valley Regional", "FIRST Dean's List Finalist Award", @@ -31,63 +24,55 @@ "Championship Subdivision Winner In Carver Divison", "Entrepreneurship Award Sponsored By Kleiner Perkins Caufield And Byers"] }, - 4322:{ - "team_name":"Clockwork Oranges", - "location":"Orange, CA", - "rookie_year":2012, - "competed_in_2019_season":True, - "2019_competition_names":[ - "San Diego Regional Presented By Qualcomm", - "Las Vegas Regional", - "Einstein Field", - "Battleship Blast Monday", - "Beach Blitz"], - "2019_competition_locations":[ - "Del Mar, CA", - "Las Vegas, NV", - "Houston, TX", - "San Pedro, CA", - "Huntington Beach, CA"], - "2019_season_awards":[ + 4322 : { + "team_name" : "Clockwork Oranges", + "location" : "Orange, CA", + "rookie_year" : 2012, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "San Diego Regional Presented By Qualcomm" : "Del Mar, CA", + "Las Vegas Regional" : "Las Vegas, NV", + "Einstein Field" : "Houston, TX", + "Battleship Blast Monday" : "San Pedro, CA", + "Beach Blitz" : "Huntington Beach, CA" + }, + "2019_season_awards" : [ "FIRST Dean's List Finalist Award", "FIRST Dean's List Award"] }, - 5458:{ - "team_name":"Digital Minds", - "location":"Woodland, CA", - "rookie_year":2015, - "competed_in_2019_season":True, - "2019_competition_names":[ - "Central Valley Regional", - "Sacramento Regional"], - "2019_competition_locations":[ - "Fresno, CA", - "Davis, CA"], - "2019_season_awards":"None" + 5458 : { + "team_name" : "Digital Minds", + "location" : "Woodland, CA", + "rookie_year" : 2015, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Central Valley Regional" : "Fresno, CA", + "Sacramento Regional" : "Davis, CA" + }, + "2019_season_awards" : "None" }, - 1:{ - "team_name":"The Juggernauts", - "location":"Pontiac, MI", - "rookie_year":1997, - "competed_in_2019_season":True, - "2019_competition_names":[ - "FIM District Center Line Event", - "FIM District Troy Event"], - "2019_competition_locations":[ - "Center Line, MI", - "Troy, MI"], + 1 : { + "team_name" : "The Juggernauts", + "location" : "Pontiac, MI", + "rookie_year" : 1997, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "FIM District Center Line Event" : "Center Line, MI", + "FIM District Troy Event" : "Troy, MI" + }, "2019_season_awards":"Imagery Award In Honor Of Jack Kamen" }, - 7229:{ - "team_name":"Electronic Eagles", - "location":"Sacramento, CA", - "rookie_year":2018, - "competed_in_2019_season":True, - "2019_competition_names":"Sacramento Regional", - "2019_competition_locations":"Davis, CA", - "2019_season_awards":"None" + 7229 : { + "team_name" : "Electronic Eagles", + "location" : "Sacramento, CA", + "rookie_year" : 2018, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Sacramento Regional" : "Davis, CA" + }, + "2019_season_awards" : "None" } } -team_number=int(input("Team Number (options are '1', '1678', '4322', '5458', '7229'):")) -team_information=input("Category (options are 'team_name', 'location', 'rookie_year', 'competed_in_2019_season','2019_competition_names', '2019_competition_locations', '2019_season_awards':") +team_number = int (input("Team Number (options are '1', '1678', '4322', '5458', '7229'):")) +team_information = input("Category (options are 'team_name', 'location', 'rookie_year', 'competed_in_2019_season','2019_competition_names_and_locations', '2019_season_awards':") print(teams[team_number][team_information]) \ No newline at end of file From 87234a1fae9005c0d0b416af9c7f79282ccff86a Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 26 Sep 2019 20:48:48 -0700 Subject: [PATCH 10/23] Get rid of function --- ch_2_assign_lucca_braudagan.py | 38 ++++++++++++++-------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py index 7c8a1dc..1856361 100644 --- a/ch_2_assign_lucca_braudagan.py +++ b/ch_2_assign_lucca_braudagan.py @@ -1,34 +1,26 @@ teams = {} -def add_team(): +initial_user_request = input("choose_from:_'add',_'view_or_modify',_'remove',_'search',_'list',_'return'") +if initial_user_request == "add": temp_team_dictionary = {} - team_number = input("What is your team's team number?") - team_name = input("What is your team's name?") - robot_name = input("What is your robot's name?") - robot_p_language = input("What is your robot's programming language?") - robot_width = input("What is your robot's width?") - robot_height = input("What is your robot's height?") - robot_camera = input("Does your robot have a camera vision system?") - robot_drivetrain = input("How many drivetrain motors does your robot have?") + teams["team_number"] = int(input("What is your team's team number?")) - temp_team_dictionary["team_name"] = team_name - temp_team_dictionary["robot_name"] = robot_name - temp_team_dictionary["robot_p_language"] = robot_p_language - temp_team_dictionary["robot_width"] = robot_width - temp_team_dictionary["robot_height"] = robot_height - temp_team_dictionary["robot_camera"] = robot_camera - temp_team_dictionary["robot_drivetrain"] = robot_drivetrain + temp_team_dictionary["team_name"] = input("What is your team's name?") + temp_team_dictionary["robot_name"] = input("What is your robot's name?") + temp_team_dictionary["robot_p_language"] = input("What is your robot's programming language?") + temp_team_dictionary["robot_width"] = input("What is your robot's width?") + temp_team_dictionary["robot_height"] = input("What is your robot's height?") + temp_team_dictionary["robot_camera"] = input("Does your robot have a camera vision system?") + temp_team_dictionary["robot_drivetrain"] = int(input("How many drivetrain motors does your robot have?")) teams[team_number] = temp_team_dictionary -initial_user_request = input("choose_from:_'add',_'view',_'modify',_'remove',_'search',_'list',_'return'") -if initial_user_request == "add": - add_team(); -elif initial_user_request == "view": - print("Nothing"), -elif initial_user_request == "modify": - print("Nothing"), +elif initial_user_request == "view_or_modify": + print(teams) + team_view = int(input("Which team would you like to see from these options?")) + if team_view in teams + information_category = input() elif initial_user_request == "remove": print("Nothing"), elif initial_user_request == "search": From 194c583af2725efb9e0da9d290cbd8ca2463a18a Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Tue, 1 Oct 2019 20:32:35 -0700 Subject: [PATCH 11/23] Do list teams --- ch_2_assign_lucca_braudagan.py | 51 ++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py index 1856361..75dc362 100644 --- a/ch_2_assign_lucca_braudagan.py +++ b/ch_2_assign_lucca_braudagan.py @@ -1,10 +1,10 @@ teams = {} -initial_user_request = input("choose_from:_'add',_'view_or_modify',_'remove',_'search',_'list',_'return'") +initial_user_request = input("Choose from: 'add' 'view_or_modify' 'remove' 'search' 'list'") if initial_user_request == "add": temp_team_dictionary = {} - teams["team_number"] = int(input("What is your team's team number?")) + team_number= int(input("What is your team's team number?")) temp_team_dictionary["team_name"] = input("What is your team's name?") temp_team_dictionary["robot_name"] = input("What is your robot's name?") @@ -15,27 +15,42 @@ temp_team_dictionary["robot_drivetrain"] = int(input("How many drivetrain motors does your robot have?")) teams[team_number] = temp_team_dictionary - + + elif initial_user_request == "view_or_modify": print(teams) team_view = int(input("Which team would you like to see from these options?")) - if team_view in teams - information_category = input() + if team_view in teams: + information_category = input("What category would you like to view or modify?") + if information_category in team_view: + new_info = input("What would you like to change this value to?") + str.replace(information_category, new_info) +# I don't think the above line is right, I don't know what to do here +# I need to have the person change the existing data + else: + print("This is not an existing team number.") elif initial_user_request == "remove": - print("Nothing"), + print(teams) + delete_team = int(input("Which team would you like to remove from these options?")) + if delete_team in teams: + print("?") +# I don't know what to do here +# I need to have the team dictionary they specify be removed elif initial_user_request == "search": - print("Nothing"), + print(teams) + search_teams = input("Which team would you like to see from these options?") + if search_teams in teams: + print(search_teams) +# I don't know what to do here +# Are they supposed to be able to go into a team here? Isn't that view_or_modify? + else: + print("That is not an existing team number.") elif initial_user_request == "list": - print("Nothing"), -elif initial_user_request == "return": - print("Nothing"), + print(teams) + print("These are the current teams in the dictionary.") else: - print("Nothing"), - - -#add_team() citrus circuits, c++, 1678 - -#{1678 : {"name" : "citrus circuits", "p_l" : "c++"}} - - + print("That is not a search option.") +# How do I make it return to initial_user_request? +# How can I return to main menu from an if, elif, or else? +# How do I make it so I could perform a second action and actually have something in teams{}, i.e. not restart the whole code to do something else? \ No newline at end of file From 9bcd2e5c4927ebe0bb56d16a390300bcd85f4a4f Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 2 Oct 2019 20:48:48 -0700 Subject: [PATCH 12/23] Remove team --- ch_2_assign_lucca_braudagan.py | 101 +++++++++++++++++---------------- 1 file changed, 53 insertions(+), 48 deletions(-) diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py index 75dc362..1e1f070 100644 --- a/ch_2_assign_lucca_braudagan.py +++ b/ch_2_assign_lucca_braudagan.py @@ -1,56 +1,61 @@ teams = {} -initial_user_request = input("Choose from: 'add' 'view_or_modify' 'remove' 'search' 'list'") -if initial_user_request == "add": - temp_team_dictionary = {} +while True: + initial_user_request = input("Choose from: 'add' 'view_or_modify' 'remove' 'search' 'list' ") + if initial_user_request == "add": + temp_team_dictionary = {} - team_number= int(input("What is your team's team number?")) + team_number= int(input("What is your team's team number? ")) - temp_team_dictionary["team_name"] = input("What is your team's name?") - temp_team_dictionary["robot_name"] = input("What is your robot's name?") - temp_team_dictionary["robot_p_language"] = input("What is your robot's programming language?") - temp_team_dictionary["robot_width"] = input("What is your robot's width?") - temp_team_dictionary["robot_height"] = input("What is your robot's height?") - temp_team_dictionary["robot_camera"] = input("Does your robot have a camera vision system?") - temp_team_dictionary["robot_drivetrain"] = int(input("How many drivetrain motors does your robot have?")) + temp_team_dictionary["team_name"] = input("What is your team's name? ") + temp_team_dictionary["robot_name"] = input("What is your robot's name? ") + temp_team_dictionary["robot_p_language"] = input("What is your robot's programming language? ") + temp_team_dictionary["robot_width"] = input("What is your robot's width? ") + temp_team_dictionary["robot_height"] = input("What is your robot's height? ") + temp_team_dictionary["robot_camera"] = input("Does your robot have a camera vision system? ") + temp_team_dictionary["robot_drivetrain"] = int(input("How many drivetrain motors does your robot have? ")) - teams[team_number] = temp_team_dictionary + teams[team_number] = temp_team_dictionary - -elif initial_user_request == "view_or_modify": - print(teams) - team_view = int(input("Which team would you like to see from these options?")) - if team_view in teams: - information_category = input("What category would you like to view or modify?") - if information_category in team_view: - new_info = input("What would you like to change this value to?") - str.replace(information_category, new_info) -# I don't think the above line is right, I don't know what to do here -# I need to have the person change the existing data - else: - print("This is not an existing team number.") -elif initial_user_request == "remove": - print(teams) - delete_team = int(input("Which team would you like to remove from these options?")) - if delete_team in teams: - print("?") -# I don't know what to do here -# I need to have the team dictionary they specify be removed -elif initial_user_request == "search": - print(teams) - search_teams = input("Which team would you like to see from these options?") - if search_teams in teams: - print(search_teams) -# I don't know what to do here -# Are they supposed to be able to go into a team here? Isn't that view_or_modify? + elif initial_user_request == "view_or_modify": + team_view = int(input("Which team would you like to view? ")) + if team_view in teams: + information_category = input("What category would you like to view or modify? ") + if information_category in teams[team_view]: + print(teams[team_view][information_category]) + new_info = input("What would you like to change this value to? ") + teams[team_view][information_category] = new_info + else: + print("This is not an information category.") + else: + print("This is not an existing team number.") + + elif initial_user_request == "remove": + delete_team = int(input("Which team would you like to remove? ")) + if delete_team in teams: + teams.pop(delete_team, None) + else: + print("This is not an existing team number.") + + elif initial_user_request == "search": + search_teams = input("Which team would you like to see? (By name or number) ") + for team, category in teams.items(): + found_team = False + if search_teams == category["team_name"]: + print("This is an existing team in the dictionary.") + found_team = True + continue + elif int(search_teams) == team: + print("This is an existing team in the dictionary.") + found_team = True + continue + if found_team != True: + print("This is not an existing team.") + + elif initial_user_request == "list": + print(teams) + print("These are the current teams in the dictionary.") + else: - print("That is not an existing team number.") -elif initial_user_request == "list": - print(teams) - print("These are the current teams in the dictionary.") -else: - print("That is not a search option.") + print("That is not a search option.") -# How do I make it return to initial_user_request? -# How can I return to main menu from an if, elif, or else? -# How do I make it so I could perform a second action and actually have something in teams{}, i.e. not restart the whole code to do something else? \ No newline at end of file From fbd8d0342866b62390a8e161fc0d86d725b2d6e4 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 3 Oct 2019 19:29:39 -0700 Subject: [PATCH 13/23] Fix search and list options --- ch_2_assign_lucca_braudagan.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py index 1e1f070..5c3ad60 100644 --- a/ch_2_assign_lucca_braudagan.py +++ b/ch_2_assign_lucca_braudagan.py @@ -44,16 +44,17 @@ if search_teams == category["team_name"]: print("This is an existing team in the dictionary.") found_team = True - continue - elif int(search_teams) == team: + break + elif search_teams[0].isdigit() and int(search_teams) == team: print("This is an existing team in the dictionary.") found_team = True - continue + break if found_team != True: print("This is not an existing team.") elif initial_user_request == "list": - print(teams) + for team in teams.keys(): + print(team) print("These are the current teams in the dictionary.") else: From 61fe531ccc16caeac71461cc6e14f7f0c83fa323 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 9 Oct 2019 19:41:16 -0700 Subject: [PATCH 14/23] Change file name --- ch_1_assign_lucca_braudagan.py | 78 ++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 ch_1_assign_lucca_braudagan.py diff --git a/ch_1_assign_lucca_braudagan.py b/ch_1_assign_lucca_braudagan.py new file mode 100644 index 0000000..08f913a --- /dev/null +++ b/ch_1_assign_lucca_braudagan.py @@ -0,0 +1,78 @@ +teams = { + 1678 : { + "team_name" : "Citrus Circuits", + "location" : "Davis, CA", + "rookie_year" : 2005, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Central Valley Regional" : "Fresno, CA", + "Sacramento Regional" : "Davis, CA", + "Aerospace Valley Regional" : "Lancaster, CA", + "Carver Division" : "Houston, TX", + "Einstein Field" : "Houston, TX", + "RCC Qianjiang International Robotics Invitational" : "Hangzhou, Zhejiang, China", + "Chezy Champs" : "San Jose, CA" + }, + "2019_season_awards" : [ + "Regional Chairman's Award At Central Valley Regional", + "Regional Winners At Central Valley Regional", + "FIRST Dean's List Finalist Award", + "Regional Winners At Sacramento Regional", + "Industrial Design Award Sponsored By General Motors", + "Regional Winners At Aerospace Valley Regional", + "Excellence In Engineering Award Sponsered By Delphi", + "Championship Subdivision Winner In Carver Divison", + "Entrepreneurship Award Sponsored By Kleiner Perkins Caufield And Byers"] + }, + 4322 : { + "team_name" : "Clockwork Oranges", + "location" : "Orange, CA", + "rookie_year" : 2012, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "San Diego Regional Presented By Qualcomm" : "Del Mar, CA", + "Las Vegas Regional" : "Las Vegas, NV", + "Einstein Field" : "Houston, TX", + "Battleship Blast Monday" : "San Pedro, CA", + "Beach Blitz" : "Huntington Beach, CA" + }, + "2019_season_awards" : [ + "FIRST Dean's List Finalist Award", + "FIRST Dean's List Award"] + }, + 5458 : { + "team_name" : "Digital Minds", + "location" : "Woodland, CA", + "rookie_year" : 2015, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Central Valley Regional" : "Fresno, CA", + "Sacramento Regional" : "Davis, CA" + }, + "2019_season_awards" : "None" + }, + 1 : { + "team_name" : "The Juggernauts", + "location" : "Pontiac, MI", + "rookie_year" : 1997, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "FIM District Center Line Event" : "Center Line, MI", + "FIM District Troy Event" : "Troy, MI" + }, + "2019_season_awards":"Imagery Award In Honor Of Jack Kamen" + }, + 7229 : { + "team_name" : "Electronic Eagles", + "location" : "Sacramento, CA", + "rookie_year" : 2018, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Sacramento Regional" : "Davis, CA" + }, + "2019_season_awards" : "None" + } +} +team_number = int (input("Team Number (options are '1', '1678', '4322', '5458', '7229'):")) +team_information = input("Category (options are 'team_name', 'location', 'rookie_year', 'competed_in_2019_season','2019_competition_names_and_locations', '2019_season_awards':") +print(teams[team_number][team_information]) \ No newline at end of file From cebdd222ac1c55deca428355deba62c5d02a3ad7 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 9 Oct 2019 19:42:05 -0700 Subject: [PATCH 15/23] Functions --- ch_3_assign_lucca_braudagan.py | 150 +++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 ch_3_assign_lucca_braudagan.py diff --git a/ch_3_assign_lucca_braudagan.py b/ch_3_assign_lucca_braudagan.py new file mode 100644 index 0000000..e29c523 --- /dev/null +++ b/ch_3_assign_lucca_braudagan.py @@ -0,0 +1,150 @@ +def add_team(): + temp_team_dictionary = {} + + team_number= int(input("What is your team's team number? ")) + + temp_team_dictionary["team_name"] = input("What is your team's name? ") + temp_team_dictionary["robot_name"] = input("What is your robot's name? ") + temp_team_dictionary["robot_p_language"] = input("What is your robot's programming language? ") + temp_team_dictionary["robot_width"] = input("What is your robot's width? ") + temp_team_dictionary["robot_height"] = input("What is your robot's height? ") + temp_team_dictionary["robot_camera"] = input("Does your robot have a camera vision system? ") + temp_team_dictionary["robot_drivetrain"] = int(input("How many drivetrain motors does your robot have? ")) + + teams[team_number] = temp_team_dictionary + +def view_or_modify_team(team_view): + if team_view in teams: + information_category = input("What category would you like to view or modify? ") + if information_category in teams[team_view]: + print(teams[team_view][information_category]) + new_info = input("What would you like to change this value to? ") + teams[team_view][information_category] = new_info + else: + print("This is not an information category.") + else: + print("This is not an existing team number.") + +def remove_team(delete_team): + if delete_team in teams: + teams.pop(delete_team, None) + else: + print("This is not an existing team number.") + +def search_team(search_teams): + for team, category in teams.items(): + found_team = False + if search_teams == category["team_name"]: + print("This is an existing team in the dictionary.") + found_team = True + break + elif search_teams[0].isdigit() and int(search_teams) == team: + print("This is an existing team in the dictionary.") + found_team = True + break + if found_team != True: + print("This is not an existing team.") + +def list_team(): + for team in teams.keys(): + print(team) + print("These are the current teams in the dictionary.") + +teams = { + 1678 : { + "team_name" : "Citrus Circuits", + "location" : "Davis, CA", + "rookie_year" : 2005, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Central Valley Regional" : "Fresno, CA", + "Sacramento Regional" : "Davis, CA", + "Aerospace Valley Regional" : "Lancaster, CA", + "Carver Division" : "Houston, TX", + "Einstein Field" : "Houston, TX", + "RCC Qianjiang International Robotics Invitational" : "Hangzhou, Zhejiang, China", + "Chezy Champs" : "San Jose, CA" + }, + "2019_season_awards" : [ + "Regional Chairman's Award At Central Valley Regional", + "Regional Winners At Central Valley Regional", + "FIRST Dean's List Finalist Award", + "Regional Winners At Sacramento Regional", + "Industrial Design Award Sponsored By General Motors", + "Regional Winners At Aerospace Valley Regional", + "Excellence In Engineering Award Sponsered By Delphi", + "Championship Subdivision Winner In Carver Divison", + "Entrepreneurship Award Sponsored By Kleiner Perkins Caufield And Byers"] + }, + 4322 : { + "team_name" : "Clockwork Oranges", + "location" : "Orange, CA", + "rookie_year" : 2012, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "San Diego Regional Presented By Qualcomm" : "Del Mar, CA", + "Las Vegas Regional" : "Las Vegas, NV", + "Einstein Field" : "Houston, TX", + "Battleship Blast Monday" : "San Pedro, CA", + "Beach Blitz" : "Huntington Beach, CA" + }, + "2019_season_awards" : [ + "FIRST Dean's List Finalist Award", + "FIRST Dean's List Award"] + }, + 5458 : { + "team_name" : "Digital Minds", + "location" : "Woodland, CA", + "rookie_year" : 2015, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Central Valley Regional" : "Fresno, CA", + "Sacramento Regional" : "Davis, CA" + }, + "2019_season_awards" : "None" + }, + 1 : { + "team_name" : "The Juggernauts", + "location" : "Pontiac, MI", + "rookie_year" : 1997, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "FIM District Center Line Event" : "Center Line, MI", + "FIM District Troy Event" : "Troy, MI" + }, + "2019_season_awards":"Imagery Award In Honor Of Jack Kamen" + }, + 7229 : { + "team_name" : "Electronic Eagles", + "location" : "Sacramento, CA", + "rookie_year" : 2018, + "competed_in_2019_season" : True, + "2019_competition_names_and_locations" : { + "Sacramento Regional" : "Davis, CA" + }, + "2019_season_awards" : "None" + } +} + +while True: + initial_user_request = input("Choose from: 'add' 'view_or_modify' 'remove' 'search' 'list' ") + if initial_user_request == "add": + add_team() + + elif initial_user_request == "view_or_modify": + team_view = int(input("Which team would you like to view? ")) + view_or_modify_team(team_view) + + elif initial_user_request == "remove": + delete_team = int(input("Which team would you like to remove? ")) + remove_team(delete_team) + + elif initial_user_request == "search": + search_teams = input("Which team would you like to see? (By name or number) ") + search_team(search_teams) + + elif initial_user_request == "list": + list_team() + + else: + print("That is not a search option.") From 7b6d439a2835d999b10ae8fd12f571a11de9d85b Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 9 Oct 2019 20:26:45 -0700 Subject: [PATCH 16/23] Add spaces --- ch_3_assign_lucca_braudagan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch_3_assign_lucca_braudagan.py b/ch_3_assign_lucca_braudagan.py index e29c523..b1ccca9 100644 --- a/ch_3_assign_lucca_braudagan.py +++ b/ch_3_assign_lucca_braudagan.py @@ -1,7 +1,7 @@ def add_team(): temp_team_dictionary = {} - team_number= int(input("What is your team's team number? ")) + team_number = int(input("What is your team's team number? ")) temp_team_dictionary["team_name"] = input("What is your team's name? ") temp_team_dictionary["robot_name"] = input("What is your robot's name? ") From 4cd48b658ec2e3730ff349a8880726b04997a91e Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 9 Oct 2019 20:28:23 -0700 Subject: [PATCH 17/23] Commit --- Homework#1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Homework#1 diff --git a/Homework#1 b/Homework#1 new file mode 100644 index 0000000..e69de29 From e8ec7684c9f75798a84fa3cd19f68fda0871b1d4 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 17 Oct 2019 20:46:19 -0700 Subject: [PATCH 18/23] Class --- ch_4_assign_lucca_braudagan.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ch_4_assign_lucca_braudagan.py diff --git a/ch_4_assign_lucca_braudagan.py b/ch_4_assign_lucca_braudagan.py new file mode 100644 index 0000000..e196c5e --- /dev/null +++ b/ch_4_assign_lucca_braudagan.py @@ -0,0 +1,2 @@ +from math import sqrt +class Point: From f9b5b2b0328f2c9abfb1d72325e4a079a0ef7d08 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 23 Oct 2019 20:47:37 -0700 Subject: [PATCH 19/23] Begin assignment --- ch_4_assign_lucca_braudagan.py | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ch_4_assign_lucca_braudagan.py b/ch_4_assign_lucca_braudagan.py index e196c5e..b36803e 100644 --- a/ch_4_assign_lucca_braudagan.py +++ b/ch_4_assign_lucca_braudagan.py @@ -1,2 +1,42 @@ from math import sqrt + class Point: + def __init__(self, x_value, y_value): + self.x_value = x + self.y_value = y + + def distance(self): + return sqrt(x ** 2 + y ** 2) + +class Point_3D(Point): + def __init__(self, x_value, y_value, z_value): + super().__init__(x, y) + self.z_value = z + + def distance(self): + distance_2D = super().distance() + return sqrt(distance_2D ** 2 + z ** 2) + +def int_validation(prompt): + while True: + if prompt.isdigit(): + return int(prompt) + else: + prompt = input("This is not a valid number. Try again. ") + +x_value_2D = input("What is the x-value of your 2D point? ") +x_value = int_validation(x_value_2D) + +y_value_2D = input("What is the y-value of your 2D point? ") +y_value = int_validation(y_value_2D) + + +x_value_3D = input("What is the x-value of your 3D point? ") +x_value = int_validation(x_value_3D) + +y_value_3D = input("What is the y-value of your 3D point? ") +y_value = int_validation(y_value_3D) + +z_value_3D = input("What is the z-value of your 3D point? ") +z_value = int_validation(z_value_3D) + From 2139d6cb5c194beeefc20e54bdee927a15a1e611 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 24 Oct 2019 19:47:24 -0700 Subject: [PATCH 20/23] Finish assignment --- ch_4_assign_lucca_braudagan.py | 44 +++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/ch_4_assign_lucca_braudagan.py b/ch_4_assign_lucca_braudagan.py index b36803e..5f25aa6 100644 --- a/ch_4_assign_lucca_braudagan.py +++ b/ch_4_assign_lucca_braudagan.py @@ -2,20 +2,20 @@ class Point: def __init__(self, x_value, y_value): - self.x_value = x - self.y_value = y + self.x_value = x_value + self.y_value = y_value def distance(self): - return sqrt(x ** 2 + y ** 2) + return sqrt(x_value ** 2 + y_value ** 2) class Point_3D(Point): def __init__(self, x_value, y_value, z_value): - super().__init__(x, y) - self.z_value = z + super().__init__(x_value, y_value) + self.z_value = z_value def distance(self): distance_2D = super().distance() - return sqrt(distance_2D ** 2 + z ** 2) + return sqrt(distance_2D ** 2 + z_value ** 2) def int_validation(prompt): while True: @@ -30,6 +30,8 @@ def int_validation(prompt): y_value_2D = input("What is the y-value of your 2D point? ") y_value = int_validation(y_value_2D) +point_2D = Point(x_value, y_value) +point_2D_distance = point_2D.distance() x_value_3D = input("What is the x-value of your 3D point? ") x_value = int_validation(x_value_3D) @@ -40,3 +42,33 @@ def int_validation(prompt): z_value_3D = input("What is the z-value of your 3D point? ") z_value = int_validation(z_value_3D) +point_3D = Point_3D(x_value, y_value, z_value) + +point_3D_distance = point_3D.distance() + +if point_2D_distance > point_3D_distance: + print(point_2D_distance) + print("is greater than") + print(point_3D_distance) + print("The distance of the 2D point in farther from the origin than the 3D point.") + +elif point_2D_distance < point_3D_distance: + print(point_2D_distance) + print("is less than") + print(point_3D_distance) + print("The distance of the 2D point in closer to the origin than the 3D point.") + +elif point_2D_distance == point_3D_distance: + print(point_2D_distance) + print("is equal to") + print(point_3D_distance) + print("The 2D point and 3D point are equal distance from the origin.") + +else: + print("Something went wrong. The 2D point distance is not greater than, less than, or equal to the 3D point distance from the origin.") + + + + + + From 78e67b75a62de76b38d5ea14a1e353c4f379ec9c Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 30 Oct 2019 20:37:38 -0700 Subject: [PATCH 21/23] Revise assignment --- ch_2_assign_lucca_braudagan.py | 86 +++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 23 deletions(-) diff --git a/ch_2_assign_lucca_braudagan.py b/ch_2_assign_lucca_braudagan.py index 5c3ad60..cb455ad 100644 --- a/ch_2_assign_lucca_braudagan.py +++ b/ch_2_assign_lucca_braudagan.py @@ -1,3 +1,19 @@ +def int_check(user_input): + while True: + if user_input.isdigit(): + return(int(user_input)) + else: + user_input = input("This is not a numeral value for your input. Try again. ") + +def bool_check(user_input): + while True: + if user_input.upper() == "TRUE": + return(True) + elif user_input.upper() == "FALSE": + return(False) + else: + user_input = input("This is not a boolean value for your input. Try again. (Input 'True' or 'False') ") + teams = {} while True: @@ -5,33 +21,54 @@ if initial_user_request == "add": temp_team_dictionary = {} - team_number= int(input("What is your team's team number? ")) - + team_number = input("What is your team's team number? ") + team_number = int_check(team_number) + temp_team_dictionary["team_name"] = input("What is your team's name? ") temp_team_dictionary["robot_name"] = input("What is your robot's name? ") temp_team_dictionary["robot_p_language"] = input("What is your robot's programming language? ") - temp_team_dictionary["robot_width"] = input("What is your robot's width? ") - temp_team_dictionary["robot_height"] = input("What is your robot's height? ") - temp_team_dictionary["robot_camera"] = input("Does your robot have a camera vision system? ") - temp_team_dictionary["robot_drivetrain"] = int(input("How many drivetrain motors does your robot have? ")) + robot_width = input("What is your robot's width? ") + temp_team_dictionary["robot_width"] = int_check(robot_width) + robot_height = input("What is your robot's height? ") + temp_team_dictionary["robot_height"] = int_check(robot_height) + robot_camera = input("Does your robot have a camera vision system? (Input 'True' or 'False') ") + temp_team_dictionary["robot_camera"] = bool_check(robot_camera) + robot_drivetrain = input("How many drivetrain motors does your robot have? ") + temp_team_dictionary["robot_drivetrain"] = int_check(robot_drivetrain) teams[team_number] = temp_team_dictionary elif initial_user_request == "view_or_modify": - team_view = int(input("Which team would you like to view? ")) + team_view_uncheck = input("Which team would you like to view? ") + team_view = int_check(team_view_uncheck) + if team_view in teams: information_category = input("What category would you like to view or modify? ") + integer_inputs = ["robot_width", "robot_height", "robot_drivetrain"] if information_category in teams[team_view]: - print(teams[team_view][information_category]) - new_info = input("What would you like to change this value to? ") - teams[team_view][information_category] = new_info + if information_category in integer_inputs: + print(teams[team_view][information_category]) + new_info_uncheck = input("What would you like to change this value to? ") + new_info = int_check(new_info_uncheck) + teams[team_view][information_category] = new_info + elif information_category == "robot_camera": + print(teams[team_view][information_category]) + new_info_uncheck = input("What would you like to change this value to? ") + new_info = bool_check(new_info_uncheck) + teams[team_view][information_category] = new_info + else: + print(teams[team_view][information_category]) + new_info = input("What would you like to change this value to? ") + teams[team_view][information_category] = new_info else: print("This is not an information category.") else: print("This is not an existing team number.") elif initial_user_request == "remove": - delete_team = int(input("Which team would you like to remove? ")) + delete_team_uncheck = input("Which team would you like to remove? ") + delete_team = int_check(delete_team_uncheck) + if delete_team in teams: teams.pop(delete_team, None) else: @@ -39,18 +76,21 @@ elif initial_user_request == "search": search_teams = input("Which team would you like to see? (By name or number) ") - for team, category in teams.items(): - found_team = False - if search_teams == category["team_name"]: - print("This is an existing team in the dictionary.") - found_team = True - break - elif search_teams[0].isdigit() and int(search_teams) == team: - print("This is an existing team in the dictionary.") - found_team = True - break - if found_team != True: - print("This is not an existing team.") + if teams == {}: + print("There are no teams in the dictionary.") + else: + for team, category in teams.items(): + found_team = False + if search_teams == category["team_name"]: + print("This is an existing team in the dictionary.") + found_team = True + break + elif search_teams[0].isdigit() and int(search_teams) == team: + print("This is an existing team in the dictionary.") + found_team = True + break + if found_team != True: + print("This is not an existing team.") elif initial_user_request == "list": for team in teams.keys(): From d15d660e528a8eac09558309af6b099b30fca329 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Wed, 6 Nov 2019 20:48:07 -0800 Subject: [PATCH 22/23] Fourth assignment --- optional_assignments.py | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 optional_assignments.py diff --git a/optional_assignments.py b/optional_assignments.py new file mode 100644 index 0000000..9224292 --- /dev/null +++ b/optional_assignments.py @@ -0,0 +1,64 @@ +""" +#1 assignment +def divisible(x, y): + if x % y == 0: + return True + else: + return False +""" +""" +#2 assignment +def cent_change(cents): + dollars = cents // 100 + a = cents % 100 + quarters = a // 25 + b = a % 25 + dimes = b // 10 + c = b % 10 + nickels = c // 5 + d = c % 5 + pennies = d +""" +""" +#3 assignment +def fibonacci(): + a = 0 + b = 1 + for i in range(1, 20): + c = a + b + a = b + b = c + print(a) +fibonacci() +""" + +#4 assignment +def int_check(user_input): + while True: + if user_input.isdigit(): + return(int(user_input)) + else: + user_input = input("This is not a numeral value for your input. Try again. ") + + +def factorial(number): + a = number + b = number - 1 + for cat in range(1, number): + c = a * b + a = c + b = b - 1 + return(a) + + +def calculating_e(): + a = 1 + for yowl in range(1, 20): + a += 1 / factorial(yowl) + return(a) + + +purr = input("Input a number. ") +meow = int_check(purr) +print(factorial(meow)) +print(calculating_e()) From a136d76193649828e3c49705f9f6f244df1cb1c0 Mon Sep 17 00:00:00 2001 From: luccambraudagan Date: Thu, 14 Nov 2019 20:47:18 -0800 Subject: [PATCH 23/23] Minimum --- numbers.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 numbers.py diff --git a/numbers.py b/numbers.py new file mode 100644 index 0000000..dec3207 --- /dev/null +++ b/numbers.py @@ -0,0 +1,21 @@ +#def int_validation(prompt): +# while True: +# if prompt.isdigit(): +# return int(prompt) +# else: +# prompt = input("This is not a valid number. Try again. ") + + +def minimum(numbers): + smallest_number = numbers[0] + for index in range(1, 5): + if smallest_number < numbers[index]: + pass + else: + smallest_number = numbers[index] + return smallest_number + + +def next_smallest(numbers): + next_smallest_number = numbers[0] +