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
Help need urgently answer ​
skad [1K]

Answer:

Explanation:

b

6 0
3 years ago
Read 2 more answers
What is the intermediate value of arr after two iterations of the outer for loop in the call sort(arr)
astra-53 [7]

The intermediate value of arr after two iterations of the outer for loop in the call sort(arr) is option C of the image attached.

<h3>What is intermediate value in programming?</h3>

This is known to be a variable that is often employed in assisting so that one can be able to compute what they want

Concluisvely, The intermediate value of arr after two iterations of the outer for loop in the call sort(arr) is option C of the image is because it will help you to have what you are after with the codes.

Learn more about ntermediate value from

brainly.com/question/11195842

#SPJ2

5 0
3 years ago
Read 2 more answers
You will create two classes, one for a box and one for a triangle. Each of the figures, the box and the triangle, will have an o
Softa [21]

I believe it should be

6 0
3 years ago
____ are programs that enable the browser to work with an embedded object.
DerKrebs [107]
HTML's to learn more go to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/embed
5 0
4 years ago
PLEASE SOMEONE ANSWER THIS
GuDViN [60]

Answer:

Any of these?

Explanation:

1147. 4117. 7411

1471. 4171

1714. 4711

1741. 7114

1417. 7141

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT true of input validation?
    7·1 answer
  • As the design phase of an SDLC begins, programming languages, development tools, and application software needed for the new inf
    13·1 answer
  • What does a contain after the following code runs?int[] a = {1, 3, 7, 0, 0, 0};int size = 3, capacity = 6, value = 5;int pos = 0
    10·1 answer
  • What is meaning of reboot
    7·2 answers
  • What is the difference between a software engineer and a system analyst?
    8·1 answer
  • The IT department at Piggy Parts BBQ has recently learned of phishing attempts that rely on social engineering to break into its
    7·1 answer
  • Which is better computer science or software engineering?
    10·2 answers
  • A data structure to store trees with an arbitrary number of children at each node is: public class TreeNode / Integer data, Tree
    10·1 answer
  • Which daemon manages the physical memory by moving process from physical memory to swap space when more physical memory is neede
    14·1 answer
  • Justice wrote a program and forgot to put the steps in the correct order. Which step does she need to review?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!