Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me in solving this assignment 1 - Write a Python class named Student with two attributes: student_id, student_name. Add a new attribute: student_class.

Please help me in solving this assignment

image text in transcribed

1 - Write a Python class named Student with two attributes: student_id, student_name. Add a new attribute: student_class. Create a function to display all attributes and their values in the student class. 2- Write a Python class named Rectangle constructed from length and width and a method that will compute the area of a rectangle. 3 - Write a Python class named Circle constructed from a radius and two methods that will compute the area and the perimeter of a circle. 4 - Follow the steps: a) Create a class. Triangle. Its _init _O method should take self, angle 1, angle2, and angle3 as arguments. Make sure to set these appropriately in the body of the init Omethod. b) Create a variable named number_of sides and set it equal to 3 . c) Create a method named check_angles. The sum of a triangle's three angles is It should return True if the sum of self.angle1, self.angle2, and self.angle3 is equal 180 , and False otherwise. d) Create a variable named my_triangle and set it equal to a new instance of your Triangle class. Pass it three angles that sum to 180 (e.g., 90, 30, 60). e) Print out my_triangle.number_of_sides and print out my_triangle.check_angles()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

Students also viewed these Databases questions

Question

1. Define and explain culture and its impact on your communication

Answered: 1 week ago