-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent.py
31 lines (26 loc) · 906 Bytes
/
student.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
rollno = 0
class Student:
def __init__(self):
self.name = input("Enter Student's Name :")
self.fathername = input("Enter Student's Father name :")
self.age = input("Enter age :")
self.year = input("Enter year:")
self.course = input("Enter course :")
self.contact = input("Enter Contact : ")
def show_detail(self):
print("Name: ",self.name)
print("Father's Name:",self.fathername)
print("Age: ",self.age)
print("Year of Joining :",self.year)
print("Course:",self.course)
print("Contact Details: ",self.contact)
def generate_rollno(self):
global rollno
rollno = rollno + 1
self.rollno = rollno
print("Roll no. of Student: ",self.rollno)
# print(rollno)
s1 = Student()
s1.generate_rollno()
s1.show_detail()
print(rollno)