In python what is wrong with this code? we have to make a class by the name of the student that has a first name, last n

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In python what is wrong with this code? we have to make a class by the name of the student that has a first name, last n

Post by answerhappygod »

In python
what is wrong with this code?
we have to make a class by the name of the student that hasa first name, last name, a list of grades instance initialization afunction that calculates the GPA, and then we have to make anobject of class a pass value to it.
In Python What Is Wrong With This Code We Have To Make A Class By The Name Of The Student That Has A First Name Last N 1
In Python What Is Wrong With This Code We Have To Make A Class By The Name Of The Student That Has A First Name Last N 1 (66.81 KiB) Viewed 10 times
class Student: H def __init__(self, first_name, last_name, grades=[]): self.first_name self.last_name self.grades = grades • grades = ["A", "B", "C", "D", "F"], - def gpa_calculation(self, grades): - Student = first_name = last_name gpa = float(input("What is your GPA: ")) if gpa == 4.0 or gpa <= 3.8: print("A") elif gpa == 3.7 or gpa <= 3.5: print("B") elif gpa == 3.4 or gpa <= 3.0: print("C") elif gpa == 3.0 or gpa <= 2.8: print("D") else: print("YOU Failed") def get_student_status(self): print(self.first_name + " " + self.last_name + 02 A1 A2 V your Grade is: " + str(self.grades))
from student_status import Student s1 = Student ("John", "Big") print(s1.get_student_status())
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply