182. Python Program to Make a Student Class with __init__
Easy__init__
Overview
Let __init__ give every new object its attributes, instead of adding them by hand.
Problem Statement
Define a class Student with an __init__ method that stores two attributes: name and marks. Read a student's name and marks (a whole number), create a Student from them, and print three lines from the object's attributes. The result is Pass for marks of 40 or more, and Fail otherwise.
Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.
Input
Two lines: the name, then the marks. Example:
Sunny
82
Output
The output for that example:
Name: Sunny
Marks: 82
Result: Pass
The tests try 4 different inputs.