15/07/2025, 14:49 Untitled87
In [5]:
listn=["Suresh","Nukal","Sumit"]
def hello():
print("Hello, My name is Manoj")
print("I am working in MNC")
print("I have daily routine ")
for i in listn:
print(i)
hello()
hello()
Hello, My name is Manoj
I am working in MNC
I have daily routine
Suresh
Nukal
Sumit
Hello, My name is Manoj
I am working in MNC
I have daily routine
Suresh
Nukal
Sumit
In [6]:
hello()
Hello, My name is Manoj
I am working in MNC
I have daily routine
Suresh
Nukal
Sumit
In [10]:
def calci(x,y):
print("Add :",x+y)
print("Sub :",x-y)
print("Mul :",x*y)
print("Div :",x/y)
print("FDiv :",x//y)
print("Exponential :",x**y)
print("Modulus :",x%y)
calci(7,9)
calci(10,8)
calci(16,3)
Add : 16
Sub : -2
Mul : 63
Div : 0.7777777777777778
FDiv : 0
Exponential : 40353607
Modulus : 7
Add : 18
Sub : 2
Mul : 80
Div : 1.25
FDiv : 1
Exponential : 100000000
Modulus : 2
Add : 19
localhost:8890/nbconvert/html/[Link]?download=false 1/3
15/07/2025, 14:49 Untitled87
Sub : 13
Mul : 48
Div : 5.333333333333333
FDiv : 5
Exponential : 4096
Modulus : 1
In [12]:
def cal(x,y,z,d):
print(x)
cal(6,8,8,8)
In [19]:
students={"Manoj":[78,89,34,55,88],
"Suresh":[78,39,34,55,88],
"Sumit":[78,80,34,55,88]
}
def findp(name):
print(f"Hi {name}. Your results are:")
print(f"Percentage of {name} is {sum(students[name])/5}")
x = input("Enter student name")
findp(x)
Enter student nameSuresh
Hi Suresh. Your results are:
Percentage of Suresh is 58.8
In [20]:
students={"Manoj":[78,89,34,55,88],
"Suresh":[78,39,34,55,88],
"Sumit":[78,80,34,55,88],
"Sohkit":[78,80,34,55,88],
"Mohit":[78,80,34,55,88],
"Purohit":[78,80,34,55,88]
}
def findp(name):
print("")
print(f"Hi {name}. Your results are:")
print(f"Percentage of {name} is {sum(students[name])/5}")
def total():
print("")
for n in students:
print(f"Percentage of {n} is {sum(students[n])/5}")
findp("Sumit")
findp("Mohit")
total()
Hi Sumit. Your results are:
Percentage of Sumit is 67.0
Hi Mohit. Your results are:
Percentage of Mohit is 67.0
Percentage of Manoj is 68.8
Percentage of Suresh is 58.8
Percentage of Sumit is 67.0
Percentage of Sohkit is 67.0
localhost:8890/nbconvert/html/[Link]?download=false 2/3
15/07/2025, 14:49 Untitled87
Percentage of Mohit is 67.0
Percentage of Purohit is 67.0
In [ ]:
students={"Manoj":[788,7783,883],
"Suresh":[2324,234,989,777],
"Sumit":[89,99,34,55,88],
}
localhost:8890/nbconvert/html/[Link]?download=false 3/3