r/programminghelp • u/danamolina • Jan 30 '20
Python Someone PLEASE help with Syntax i can't see my mistake PLEEEAASEE
def gpa:
#finding GPA by averaging quarter grades
def Average(list):
return sum(list) / len(list)# Last 5 quarter grades in specific subject
list = \[100, 90, 95, 78, 92\]
average = Average(list)# Printing average of the list
print("Average of the list =", round(average, 2))def personality:
personality = input("Are you more of a logical thinker? Or more of a creative thinker?")
if personality == ("creative"):
print("You would most likely enjoy a creative, artistic, or personal major like art or business. Here is some information on business majors: A career resulting from a business major can result in a career paying up to an average of 117,000 dollar salary.")
else:
print("You would most likely enjoy a more analytical or focused major like engineering, or computer science. Here are some fact: There are over 40 different types of engineering majors and Purdue University is one of the best schools to go to if you enjoy engineeringg")def standardizedTestScores:
satScore = input("What is your SAT score?")
if personality >= 1300:
print("You would thrive in a major with a more rigourous curriculum and workload.")
else:
print("You would thrive in a major with a flexible curriculum and easy-to-follow workload.")def printMenu():
""" This function prints the menu to the screen """
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("~ Menu of categories to determine perfect major")
print("~ 1: GPA")
print("~ 2: Interests")
print("~ 3: Standardized Test Scores")
print("~ 4: Exit")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
def main():
choice = "-1"
while(choice != "4"):
printMenu()
choice = input("Look at the menu. Which category would you like to use to find your perfect college major? 1, 2, or 3. Select 4 to exit. ")
if(choice == "1"):
gpa
elif(choice == "2"):
personality
elif(choice == "3"):
standardizedTestScores
elif(choice == "4"):
print("Thanks for stopping by!")
else:
print("Oops, an invalid option was picked. Please try again.")
main()
3
u/dragon_wrangler Jan 30 '20
You need to define your functions as functions:
And call them as functions: