Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
45ea874
added lesson file
Sep 13, 2019
7982e53
Add team info for assignment
Sep 13, 2019
9b066a1
Add requirements. Maybe complete
Sep 14, 2019
c2fdc05
Add final edits and complete assignment
Sep 15, 2019
6b6683e
Add main components. Need to debug search aspect
Sep 21, 2019
eb77fde
Add main components.
Sep 21, 2019
ee472b3
Add main components and add final touches
Sep 21, 2019
dca2d6a
Add final edits and complete assignment
Sep 21, 2019
d78af3a
Add main components and final touches
Sep 21, 2019
c6dc058
Add final touches and complete assignment
Sep 26, 2019
691a603
Redo chapter 1 assignment
Sep 26, 2019
7aaedd0
Redo Chapter 1 assignment on actual file
Sep 26, 2019
003a779
Update search function
Sep 26, 2019
54f6541
Update and complete chapter 1 assignment
Sep 27, 2019
4c42c2c
Add all requirements. Finish assignment
Sep 29, 2019
2426759
Fix typos
Oct 3, 2019
f404e22
Fix more Typos
Oct 3, 2019
195037e
Update search aspect
Oct 3, 2019
b24ce9a
Simplify and make updates to code
Oct 3, 2019
c5d53d7
Simplify modify team function
Oct 4, 2019
a94f66b
Add add_team() validation
Oct 4, 2019
e30edf0
Fix validation for add team function
Oct 4, 2019
bfc1d8e
Update validation function to validate str and int inputs
Oct 4, 2019
03ce91b
Update comment area
Oct 4, 2019
2e15ecd
add main functions
Oct 10, 2019
f1d6d54
Update modify team function
Oct 11, 2019
df30446
Update comment section
Oct 11, 2019
f7c3978
Make small changes
Oct 11, 2019
6b51215
Add validation for when inputing a team
Oct 12, 2019
42f44da
Update comment section
Oct 13, 2019
276fb23
Complete assignment
Oct 24, 2019
54e8056
make division checker
Oct 27, 2019
39a6703
Fixed validation function
Oct 31, 2019
a5472c8
Recommit assignment
Oct 31, 2019
6053b00
Fixed validation
Nov 2, 2019
1b6fab7
Made sure when the hyp are equal, it shows that they are equal
Nov 7, 2019
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
3 changes: 3 additions & 0 deletions "ch_1_lesson_sophia_palomares.py"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"ch_1_lesson_sophia_palomares.py"

print('Hello, World')
64 changes: 64 additions & 0 deletions ch_1_assign_remake_sophia_palomares.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

dictionary_1678 = {
"rookie year" : 2005,
"location" : "Davis, California, USA",
"compete in 2019" : True,
"competitions and locations" : "Central Valley Regional: Fresno, Ca, USA; Sacramento Reagional: Sacramento, CA, USA; Aerospace Valley Regional: Lancaster, CA, USA; Carver Division: Houston, TX, USA; Einstein Field: Houston, TX, USA.",
"awards" : "CHAIRMAN'S AWARD, CENTRAL VALLEY REGIONAL WINNER, SACRAMENTO REGIONAL WINNER, AEROSPACE VALLEY REGIONAL WINNER",
}

dictionary_1682 = {
"rookie year" : 2005,
"location" : "Riverside, California, USA",
"compete in 2019" : False,
"competitions" : "None",
"competitions and locations" : "None",
"awards" : "None"
}

dictionary_1690 = {
"rookie year" : 2005,
"location" : "Binyamina, HaZafon, Israel",
"competions and locations" : "ISR District Event #1: Haifa, HA 00000, Israel; ISR District Event #4: Tel Aviv-Yafo, TA 00000, Israel; FIRST Israel District Championship: Tel Aviv-Yafo, TA 00000, Israel; Darwin Division: Detroit, MI, USA; Indiana Robotics Invitational: Indianapolis, IN, USA;",
"awards" : "None"
}

dictionary_1700 = {
"rookie year" : 2005,
"location" : "Palo Alto, California, USA",
"compete in 2019" : True,
"competitions and locations" : "San Francisco Regionals: San Francisco, CA, USA; Utah Regionals: West Valley City, Utah, USA; Turing Devision: Houston, TX, USA",
"awards" : "None"
}

dictionary_2907 = {
"rookie year" : 2009,
"location" : "Auburn, Washington, USA",
"compete in 2019" : True,
"competitions and locations" : "PNW District Auburn Mountainview Event: Auburn, WA, USA; NW District West Valley Event: Spokane, WA, USA; PNW District Auburn Event: Auburn, WA, USA; Pacific Northwest FIRST District Championship: Tacoma, WA, USA; Roebling Division: Houston, TX, USA; Einstein Field: Houston, TX, USA; Peak Performance: Sea Tac, WA, USA;",
"awards" : "2019 PACIFIC NORTHWEST FIRST DISTRICT CHAMPIONSHIP, 2019 ROEBLING DIVISION",
}

dictionary_3132 = {
"rookie year" : 2010,
"location" : "Sydney, New South Wales, Australia",
"compete in 2019" : True,
"competitions and locations" : "Southern Cross Regional: Sydney Olympic Park, NSW, Australia; NSouth Pacific Regional: Sydney Olympic Park, NSW, Australia; Carver Division: Houston, TX, USA; Einstein Field: Houston, TX, USA; Duel Down Under: Sydney, New South Wales, Australia;",
"awards" : "2019 SOUTHERN CROSS REGIONAL, 2019 CARVER DIVISION",
}

teams = {
1678 : dictionary_1678,
1682 : dictionary_1682,
1690 : dictionary_1690,
1700 : dictionary_1700,
2907 : dictionary_2907,
3132 : dictionary_3132,
}

def team_info():
question1 = int(input("What team would you like to look up? options: 1678, 1682, 1690, 1700, 2907, 3132"))
question2 = input("What about the team would you like to know? options: rookie year, locations, competitions and locations, awards ")
print(teams[question1][question2])

team_info()
51 changes: 51 additions & 0 deletions ch_1_assign_sophia_palomares.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
teams = {
1678 : {
"rookie year" : 2005,
"location" : "Davis, California, USA",
"compete in 2019" : True,
"competitions and locations" : "Central Valley Regional: Fresno, Ca, USA; Sacramento Reagional: Sacramento, CA, USA; Aerospace Valley Regional: Lancaster, CA, USA; Carver Division: Houston, TX, USA; Einstein Field: Houston, TX, USA.",
"awards" : "CHAIRMAN'S AWARD, CENTRAL VALLEY REGIONAL WINNER, SACRAMENTO REGIONAL WINNER, AEROSPACE VALLEY REGIONAL WINNER",
},
1682 : {
"rookie year" : 2005,
"location" : "Riverside, California, USA",
"compete in 2019" : False,
"competitions" : "None",
"competitions and locations" : "None",
"awards" : "None"
},
1690 : {
"rookie year" : 2005,
"location" : "Binyamina, HaZafon, Israel",
"compete in 2019" : True,
"competions and locations" : "ISR District Event #1: Haifa, HA 00000, Israel; ISR District Event #4: Tel Aviv-Yafo, TA 00000, Israel; FIRST Israel District Championship: Tel Aviv-Yafo, TA 00000, Israel; Darwin Division: Detroit, MI, USA; Indiana Robotics Invitational: Indianapolis, IN, USA;",
"awards" : "None",
},
1700 : {
"rookie year" : 2005,
"location" : "Palo Alto, California, USA",
"compete in 2019" : True,
"competitions and locations" : "San Francisco Regionals: San Francisco, CA, USA; Utah Regionals: West Valley City, Utah, USA; Turing Devision: Houston, TX, USA",
"awards" : "None"
},
2907 : {
"rookie year" : 2009,
"location" : "Auburn, Washington, USA",
"compete in 2019" : True,
"competitions and locations" : "PNW District Auburn Mountainview Event: Auburn, WA, USA; NW District West Valley Event: Spokane, WA, USA; PNW District Auburn Event: Auburn, WA, USA; Pacific Northwest FIRST District Championship: Tacoma, WA, USA; Roebling Division: Houston, TX, USA; Einstein Field: Houston, TX, USA; Peak Performance: Sea Tac, WA, USA;",
},
3132 : {
"rookie year" : 2010,
"location" : "Sydney, New South Wales, Australia",
"compete in 2019" : True,
"competitions and locations" : "Southern Cross Regional: Sydney Olympic Park, NSW, Australia; NSouth Pacific Regional: Sydney Olympic Park, NSW, Australia; Carver Division: Houston, TX, USA; Einstein Field: Houston, TX, USA; Duel Down Under: Sydney, New South Wales, Australia;",
"awards" : "2019 SOUTHERN CROSS REGIONAL, 2019 CARVER DIVISION",
},
}

def look_team():
question1 = int(input("What team would you like to look up? options: 1678, 1682, 1690, 1700, 2907, 3132 "))
question2 = input("What about the team would you like to know? options: rookie year, location, competitions and locations, awards ")
print(teams[question1][question2])

look_team()
3 changes: 3 additions & 0 deletions ch_1_lesson_sophia_palomares.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"ch_1_lesson_sophia_palomares.py"

print('Hello, World')
180 changes: 180 additions & 0 deletions ch_2_assign_sophia_palomares.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
teams = {}
team_aspects = ["name", "programming language", "width", "length", "camera vision system", "drivetrain motors", "team number"]
number_aspects = ["width", "length", "drivetrain motors"]
word_aspects = ["name", "programming language", "camera vision system"]

#List of Function Operations:
#name_number functions: make team names and number interchangeable for specified functions
#remove_team: removes a team
#modify_team: modifies an attribute of a team
#search_team: searches for an attribute of a team
#add_team: adds a team to the main teams dictionary
#list_team: lists the team #, or keys in the teams dictionary
#exit_program: leaves the program
#validation: validates input for add team function
#main_function: The "main menu" for the other operations

def remove_team_name_number():
user_remove = input("What team do you want to remove? ")
for team_name_remove in teams:
if teams[team_name_remove]["name"] == user_remove:
remove_team(team_name_remove)
elif user_remove.isnumeric():
if int(user_remove) == team_name_remove:
remove_team(team_name_remove)

def remove_team(team_name_remove):
teams.pop(team_name_remove)

main_function()

def modify_team_name_number():
user_modify = input("What team do you want to modify? ")
for team_name_modify in teams:
if teams[team_name_modify]["name"] == user_modify:
modify_team(team_name_modify)
elif user_modify.isnumeric():
if int(user_modify) == team_name_modify:
modify_team(team_name_modify)

def modify_team(team_name_modify):
print("Options:")
print(team_aspects)
team_attribute_modify = input("What would you like to modify about the team? ")
for team_aspect in team_aspects:
if team_attribute_modify == team_aspect:
new_attribute = input("What is the team's updated attribute? ")
for attribute in number_aspects:
if team_attribute_modify == attribute:
new_attribute = validation_number(new_attribute)
break
for attribute in word_aspects:
if team_attribute_modify == attribute:
new_attribute = validation_word(new_attribute)
break
teams[team_name_modify][team_aspect] = new_attribute
break
else:
print("Input Unknown")
modify_team(team_name_modify)

main_function()

def add_team():
temp_team_dictionary = {}

name = input("What is the name of your team? ")
val_name = validation_word(name)
p_language = input("What is your team's programming language? ")
val_p_language = validation_word(p_language)
width = input("What is your team's robot's width? ")
val_width = validation_number(width)
length = input("Wnat is your team's robot's length? ")
val_length = validation_number(length)
cam_vision = input("Does your team's robot's have a camera vision system? ")
val_cam_vision = validation_word(cam_vision)
drive_motors = input("How many drivetrain motors does your team have? ")
val_drive_motors = validation_number(drive_motors)

temp_team_dictionary["name"] = val_name
temp_team_dictionary["programming language"] = val_p_language
temp_team_dictionary["width"] = val_width
temp_team_dictionary["length"] = val_length
temp_team_dictionary["camera vision system"] = val_cam_vision
temp_team_dictionary["drivetrain motors"] = val_drive_motors

team_number_input = input("Add a team number ")

if team_number_input[0].isdigit():
team_number_input = int(team_number_input)
teams[team_number_input] = temp_team_dictionary

else:
print("Input wasn't a number, please enter a team number")
team_number_input = int(input("Add a team number "))
teams[team_number_input] = temp_team_dictionary

main_function()

def validation_number(user_input):
if user_input.isdigit():
user_input = int(user_input)
return user_input
else:
print("User input wasn't a number, please enter a number.")
user_new_input = input("Please enter new answer: ")
validation_number(user_new_input)
return user_new_input

def validation_word(user_input):
if user_input.isdigit() == False:
return user_input
else:
print("User input wasn't a word, please enter a word")
user_new_input = input("Please enter new answer: ")
validation_word(user_new_input)
return user_new_input

def search_team_name_number():
user_search = input("What team do you want to search? ")
for team_name_search in teams:
if teams[team_name_search]["name"] == user_search:
search_team(team_name_search)
elif user_search.isnumeric():
if int(user_search) == team_name_search:
search_team(team_name_search)

def search_team(team_name_search):
print("Options:")
print(team_aspects)
user_search_specific = input("What would you like to look up about a team? ")
for team_aspect in team_aspects:
if user_search_specific == team_aspect:
print(user_search_specific)
print(teams[team_name_search][user_search_specific])
break
else:
print("Unknown Input")
search_team(team_name_search)

main_function()

def list_team():
print(teams.keys())

main_function()

def exit_program():
print("You are choosing to exit the program")
user_exit = input("Are you sure you want to leave? (y/n) ")
if user_exit == "y":
"You are now leaving the program"
return
elif user_exit == "n":
"You chose to stay in the program"
main_function()
else:
print("Input is unknown. Please input y or n")
exit_program()

def main_function():
print("Options:")
print("add team, remove team, modify team, list of teams, search for team, exit")
user_question_1 = input("What would you like to do? ")
if user_question_1 == "add team":
add_team()
elif user_question_1 == "modify team":
modify_team_name_number()
elif user_question_1 == "remove team":
remove_team_name_number()
elif user_question_1 == "search for team":
search_team_name_number()
elif user_question_1 == "list of teams":
list_team()
elif user_question_1 == "exit":
exit_program()
else:
print("Input is unknown.")
main_function()

main_function()
Loading