Professional Documents
Culture Documents
Experiment 11 Programs
Experiment 11 Programs
Experiment 11 Programs
TYCO-B 84
Experiment-11
Q.1 Prime Function
def prime(no):
i, flag = 2, True
if no % i == 0:
flag = False
break
i=i+1
if flag:
return 1
else:
return 0
if prime(n):
else:
Output
Enter a number : 11
11 is Prime Number
Enter a number : 12
Q. 2 Function Factorial
def factorial(n):
fact = 1
fact += fact * i
return fact
Output
Factorial of 4 is 24
Factorial of 5 is 120
NAME-SANGRAM S SUPALAKR
TYCO-B 84
lower = 0
upper = 0
ll = ""
lu = ""
def calupperlower(s):
for i in s:
if i.islower():
ll += i
lower = lower + 1
elif i.isupper():
lu += i
upper = upper + 1
calupperlower(s)
Output