0% found this document useful (0 votes)
6 views3 pages

Py EXP7

The document contains several Python functions that perform different tasks, including finding the maximum of three numbers, calculating the sum of cubes of a list, summing multiples of ten, and checking for vowels in a string. Each function is accompanied by a main function that demonstrates its usage with example inputs and outputs. The document illustrates basic programming concepts such as loops, conditionals, and user input.

Uploaded by

985tusharkalel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Py EXP7

The document contains several Python functions that perform different tasks, including finding the maximum of three numbers, calculating the sum of cubes of a list, summing multiples of ten, and checking for vowels in a string. Each function is accompanied by a main function that demonstrates its usage with example inputs and outputs. The document illustrates basic programming concepts such as loops, conditionals, and user input.

Uploaded by

985tusharkalel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

def nd_max(a,b,c):

if a==b and b==c:


return True
elif a>b and a>c:
return a
elif b>a and b>c:
return b
else:
return c

def main():
a=int(input("->"))
b=int(input("->"))
c=int(input("->"))
if ( nd_max(a,b,c)==True):
print("equal numbers")
else:
print( nd_max(a,b,c))

main()

OUTPUT
->13
->34
->23
34

def sc(ls):
t=0

for n in ls:
t= t+n**3

return t

def main():
l=[1,2,3,4,5]
print(sc(l))

main()

OUTPUT

225
fi
fi
fi
def ze(ls):
t=0
for i in ls:
if i%10==0:
t=t+i
return t

def main():
l=[10,23,10,20,50,10]
print(ze(l))

main()

OUTPUT

100

def ze(ls):
t=0
for i in ls:
if i%10==0:
t=t+i
return t

def main():
l=[]
for i in range(0,5):
l.append(int(input("Enter the number: ")))
print(ze(l))

main()

OUTPUT

Enter the number: 1


Enter the number: 2
Enter the number: 3
Enter the number: 40
Enter the number: 40
80
def chk(c):
ls=['a','e','i','o','u','A','E','I','O','U']
for i in ls:
if i==c:
return True
return False

def main():
c=input("->")
if chk(c):
print("it is a vowel")
else:
print("it is a consonant")

main()

OUTPUT

->E
it is a vowel

def chk(c):
ls=['a','e','i','o','u','A','E','I','O','U']
for i in ls:
if i==c:
return True
return False

def main():
cnt=0
s=input("->")
for c in s:
if chk(c):
cnt=cnt+1
print(f"number of vowels in {s} is {cnt}")

main()

OUTPUT

->kitcoek
number of vowels in kitcoek is 3

You might also like