input..
#tule cannot be changed ....round brackets
#list can be changed .....suqare bracke
#© 2022 All rights reserved
#great learning
#if and else
a=10
b=51
c=61
if a<b and b>c:
print("b is greatest ")
if a>b and a>c:
print("a is greatest ")
if c> b and a <c:
print("c is greatest ")
# loop statement........
i=1
while i<=105:
print(i)
i = i + 1
#loop statement...........................
#for loop
l1=["happy","to","arihant"]
l3=["birthday","you","jain"]
for i in l1:
for j in l3:
print(i,j)
#functions
#........not understood
#oops
#class = properties+ behaviour
#= attribute+methods
class phone :
def make_call(self):
print("making phone call")
def play_game(self):
print("i am a playing a game ")
p1=phone()
p1.make_call()
p1.play_game()
class Employee:
def __init__(self,name,age,salary,gender ):
self.name=name
self.age=age
self.salary=salary
self.gender=gender
def employee_details(self):
print("name of employee is" ,self.name)
print("age of employee is" ,self.age)
print("salary of employee is" ,self.salary)
print("gender of employee is" ,self.gender)
e1 = Employee('arihant',17,564664,'male')
e1.employee_details()
#inheritance in python
class Vehicle:
def __init__(self,mileage,cost,name):
self.mileage=mileage
self.cost=cost
self.name=name
def vehicle_details(self):
print("mileage of vehile is" ,self.mileage)
print("cost of vehile is" ,self.cost)
print("the name of the vehicle is ",self.name)
v1=Vehicle(35,54689,'honda')
v1.vehicle_details()
class Car(vehicle):
def car_details(self):
print("i am a car ")
c1=Car(541,5995,"bmw")
c1.car_details()
output
