PRACTICAL 10
1.1. Write a Python function that accepts a string and calculate the number of upper case
letters and lower case letters.
def check(str):
upper=0
lower=0
for i in str:
if [Link]():
upper+=1
elif [Link]():
lower+=1
else:
pass
print("Upper case=",upper)
print("Lower case=",lower)
str=input("Enter string to calculate upper and lower cases in string\n")
check(str)
2. Write a Python program to generate a random float where the value is between 5 and
50 using Python math module.
import random
import math
random_float = [Link](5, 50)
rounded_float = [Link](random_float)
print("Random float number between 5 and 50 =", random_float)
print("Rounded float number =", rounded_float)