Professional Documents
Culture Documents
min=a[0]
if(a[i]<min):
min=a[i]
print(a)
print(“------------------------------------------------------------------“)
print(“------------------------------------------------------------------“)
Output:
------------------------------------------------------------------
------------------------------------------------------------------
#String Functions
def disupper():
line=[]
if s:
line.append(s.upper())
else:
print(“NO STRING....”)
print(sentence)
def removal():
s=raw_input()
#print “ “.join(sorted(list(set(words))))
print “ “.join(list(set(words)))
print(“--------STRING FUNCTIONS-----------“)
while True:
if(choice==1):
disupper()
elif(choice==2):
removal()
else:
break
print(“Bye”)
Output:
--------STRING FUNCTIONS-----------
1. Convert to UPPERCASE...........
Bye
#Program to Count the number of letters and digits
print(“ **************************************** “)
s=raw_input()
d={“DIGITS”:0, “LETTERS”:0}
for c in s:
if c.isdigit():
d[“DIGITS:]+=1
elif c.isalpha():
d[“LETTERS”]+=1
else:
pass
****************************************
import calendar
def dispcal():
calendar.prcal(year)
def dispmonth():
print(calendar.month(year1,mon1))
def display():
c=calendar.TextCalendar(calendar.FRIDAY)
str=c.formatmonth(2022,4)
print(str)
print(“------------CALENDAR FUNCTIONS-------------“)
while True:
if(choice==1):
dispcal()
elif(choice==2):
dispmonth()
else:
break
print(“Bye”)
Output
------------CALENDAR FUNCTIONS-------------