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

Function Assignment2

Uploaded by

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

Function Assignment2

Uploaded by

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

Assignment Questions of Functions of Python Set 2,Question and Answer should be

written neatly in the Notebook. For output Based questions , manual processing
should be shown so that you will get a better perspective of how it is executed.

1. Define a function checkgreat(n1,n2,n3) where n1,n2,n3 are integer arguments


. Return the greatest among three numbers and the average of the three
arguments.
2. Define a function squarecube(x) that returns the cube and square of a number
passed as argument
3. Define a function arithop(num1,num2) which returns the power of the first
number raised to second number,reminder of num2/ num1 , difference of
num2 from num1

Predict the output

4. def CALLME(n1,n2):
n1=n1*n2
n2+=2
print(n1,n2)

CALLME(10,20 )
CALLME(2,1)
n2=9;n3=6
CALLME(n2,n3)
print(n2,n3)

5. def updatelist(mylist):
print(mylist)
for i in range(len(mylist)):
mylist[i]+=20
return mylist

list1=[20,42,19,90,30]
list1.extend(updatelist(list1))
print(list1)

6. def jumble(str1):
str2=' '
cu=0
for i in range(len(str1)):
if str[i].islower():
str2+=str1[i].upper()
elif str[i].isupper():
str2+=str1[i].lower()
elif str[i].isdigit():
str2+='*-"
else:
str2+='@'
return str2

msg=”Hello Class 2024-25”


print(“The word :”,jumble(msg))
print(“The message:”, msg+” share and grow”)

You might also like