1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
stepan [7]
3 years ago
7

I’m failing this class and i’m stuck on this one, this is the code from the last lesson:

Computers and Technology
1 answer:
serg [7]3 years ago
6 0

lst=([])

def avgGPA(lst1):

   total = 0

   count = 0

   for x in lst:

       if type(x) == int:

           total += x

           count += 1

   return total/count

def GPAcalc(grade, weighted):

   grade = grade.lower()

   dictionary = {"a": 4, "b": 3, "c": 2, "d": 1, "f": 0}

   if weighted == 1 and grade in dictionary:

       lst.append(dictionary[grade]+1)

       return "Your GPA score is: " + str(dictionary[grade] + 1)

   elif weighted == 0 and grade in dictionary:

       lst.append(dictionary[grade])

       return "Your GPA score is: " + str(dictionary[grade])

   else:

       lst.append("Invalid")

       return "Invalid"

classes = int(input("How many Classes are you taking? "))

i = 0

while i < classes:

   print(GPAcalc(input("Enter your Letter Grade: "), int(input("Is it weighted? (1 = yes) "))))

   i += 1

print("Your weighted GPA is a "+str(avgGPA(lst)))

If you need me to change any code, I'll do my best. I hope this helps!

You might be interested in
When you include a word cover page in a multi page document, the cover page is not considered the first page. True or false?
____ [38]
It ture on the cover page include
4 0
3 years ago
Which career involves analyzing various factors that influence the customer decision-making process?
Olegator [25]

Which career involves analyzing various factors that influence the customer decision-making process? Marketing and advertising. When you work in the marketing and advertising career field, you are influencing the customers decision-making process by trying to get them to purchase your product. There are different ways to gain the loyalty of a customer and making sure that your product grabs their attention is necessary.

5 0
3 years ago
When computer network are joined together they form a bigger network called the​
Airida [17]

Answer:

A WAN can be one large network or can consist of two or more lans connected together. The Internet is the world's largest wan.

Explanation:

8 0
3 years ago
Is ryan patrick cullen gay
pshichka [43]

who is that? ..........

6 0
3 years ago
Read 2 more answers
In a proper webpage, which tag holds all of a webpages visble HTML
Furkat [3]
If I remember correctly, I believe it's <body></body>
6 0
3 years ago
Read 2 more answers
Other questions:
  • What must you do first in order to change the font type size and colour of a particular text
    13·2 answers
  • Which is the quickest way to change the font color in multiple, randomly located cells in a worksheet
    8·2 answers
  • List and explain the error in the code
    14·1 answer
  • Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive). Sample output w
    12·1 answer
  • Traffic that is encrypted will typically pass by an intrusion prevention system untouched.a. Trueb. False
    10·1 answer
  • Set methods are also commonly called _____ methods, and get methods are also commonly called _____ methods.
    6·1 answer
  • A special type of loans for houses
    9·2 answers
  • Clarice is an architect who is involved in design work on a restaurant in a building that used to be part of the city’s water wo
    8·1 answer
  • when you insert a new column, the existing columns are shifted to the ____ and the new column has the same width as the column d
    10·1 answer
  • Hazel has taught herself a variety of computer languages. She enjoys using her knowledge to write the programs for applications
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!