-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop1.py
More file actions
148 lines (117 loc) · 3.43 KB
/
Copy pathoop1.py
File metadata and controls
148 lines (117 loc) · 3.43 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
print("Python object oriented programming")
# l = [1,2,3]
# l.upper()
#oop - class ,object,encapsulation,inheritance,polymorphism,abstraction
# l = [1,2,3]
# print(type(l))
#class - property/attribute - blueprint of object
# class Student:
# def __init__(self)
# st1 = Student()
# class Human:
# def __init__(self):
# print("Human object created")
# asif = Human()
# class Student:
# def __init__(self):
# self.name = "Asif"
# self.age = 25
# self.course ="CSE"
# print(f"name:{self.name} age:{self.age} course:{self.course}")
# stu_asif = Student()
# class Student:
# def __init__(self,name,age,course):
# self.name = name
# self.age = age
# self.course = course
# print(f"name:{self.name} age:{self.age} course:{self.course}")
# student1 = Student("Probin",24,"EEE")
# student2 = Student("Asif",25,"CSE")
# print(type(student1))
# class Atm:
# def __init__(self):
# self.balance = 0
# self.pin =""
# self.menu()
# def menu(self):
# user_input=input("""Hi
# How can i help you?
# 1.Press 1 to create pin
# 2.Press 2 to change pin
# 3.Press 3 to debit balance
# 4.Press 4 to withdraw balance
# 5.Press 5 to check balance
# 6.Press 6 to exit\n""")
# if user_input =="1":
# self.create_pin()
# elif user_input =="2":
# self.change_pin()
# elif user_input =="3":
# self.credit_balance()
# elif user_input =="4":
# self.withdraw_balance()
# elif user_input =="5":
# self.check_balance()
# else:
# self.menu()
# self.menu()
# def create_pin(self):
# user_pin = input("Enter pin:")
# self.pin = user_pin
# print("Pin created successfully")
# def change_pin(self):
# user_pin = input("Enter your pin:")
# if user_pin == self.pin:
# new_pin = input("Enter new pin:")
# self.pin = new_pin
# print("New pin created")
# else:
# print("Wrong pin")
# def credit_balance(self):
# user_pin = input("Enter your pin:")
# if user_pin == self.pin:
# balance = int(input("Enter your balance:"))
# self.balance = balance
# print("Balance credited successfully")
# else:
# print("Wrong pin")
# def withdraw_balance(self):
# user_pin = input("Enter your pin:")
# if self.pin == user_pin:
# withdraw_balance = int(input("Enter amount to withdraw:"))
# if withdraw_balance < self.balance:
# self.balance = self.balance - withdraw_balance
# print(f"{withdraw_balance} withdrawn successfully")
# print(f"current balance is:{self.balance}")
# else:
# print("You don't have thar much balance")
# else:
# print("Wrong pin")
# def check_balance(self):
# print("current balance is {}".format(self.balance))
# obj = Atm()
# class Student:
# def __init__(self,name,age,course):
# self.name = name
# self.age = age
# self.course = course
# def read():
# print()
# class Car:
# def __init__(self):
# print(id(self))
# def __str__(self):
# print("Object got created")
# bmw = Car()
# print(id(bmw))
# # print(bmw)
# class Car:
# def __init__(Self,name,model):
# Self.name = name
# Self.model = model
# def __str__(Self):
# return f"Car name:{Self.name} model:{Self.model}"
# bmw =Car("BMW","X6")
# print(bmw)
# audi = Car("Audi","R8")
# print(audi)