greater learning python couse source code

 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
 
 
Python Programming in Hindi
 

c is greatest
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
happy birthday
happy you
happy jain
to birthday
to you
to jain
arihant birthday
arihant you
arihant jain
making phone call
i am a playing a game
name of employee is arihant
age of employee is 17
salary of employee is 564664
gender of employee is male
mileage of vehile is 35
cost of vehile is 54689
the name of the vehicle is honda 

ARIHANT JAIN

i am arihant jain and i am a student

Post a Comment (0)
Previous Post Next Post