Professional Documents
Culture Documents
Set 5
Set 5
#3-wap program to exchange two values of two numbers without using temporary
variable
# for i in range(0,l):
# 7-wap program to take in the marks of 5 subjects and display the grade(not
completed)
# a=[]
# avg=0
# grade=0
# for i in range(0,5):
# l1= int(input("enter marks of subject"))
# a.append(l1)
# avg=sum(a)/5
# if avg>75:
# grade='a'
# elif avg>60:
# grade='b'
# elif avg>45:
# grade='c'
# else:
# grade='d'
# print(grade)
# print(a[i])
# 9-wap program to read two numbers and print their quotient and reminder
# 10-wap to accept three digits and print all possible combinations from the
digits(not completed)
# for i in s:
# s.append(a)
# s +=a[i]
# print(s)
# str=input("enter a string")
# if str==reverse():
# print("the given string is palindrome")
# else:
# print("the given string is not palindrome")
# 16-wap program to print all integers that aren't divisible by either 2 or 3 and
lie between 1 and 50
# a=[]
# for i in range(1,50):
# if i%2!=0 and i%3!=0:
# a.append(i)
# print(a)
# 20-python program to read list of words and return the longest one
# l1=input("enter the list of words")
# l1=l1.split()
# l1.sort()
# print("longest word is",l1.
# 23-python program to take in a string and replace every blank space with hyphen
# s= input("enter a string")
# s1=[]
# for i in range(len(s)):
# if (s[i]==''):
# s1=s.replace('','-')
# print(s)
# print(s1)
# 24-python program to calculate the no. of uppercase letters and lowercase letters
in a string
# s= input("enter a string")
# u=0
# l=0
# for i in s:
# if(i.isupper()):
# u=u+1
# else:
# l=l+1
# print("no. of uppercase",u)
# print("no. of lowercase",l)
# 25-python program to count the occurance of each word in a given string sentence
# s=input("enter a string")
# s1=[]