You are on page 1of 1

PRACTICAL NO.

10

Name: Pranav Sandip Wadge. print("Random Float between 9 and 90:=",


random_float)
Roll_No:03.
OUTPUT:
Branch: TYCO.
Random Float between 9 and 90:=
-------------------------------------------------------
71.33686407923824
1. Write a Python function that accepts a
string and calculate the number of upper
**********************
case letters and lower case letters.

str = input("Enter a string:= ")


uppercase = 0
lowercase = 0

for char in str:


if char.isupper():
uppercase += 1
elif char.islower():
lowercase += 1
print(f"Uppercase letters:=
{uppercase}")
print(f"Lowercase letters:=
{lowercase0}")

OUTPUT:

Enter a string:= AmG

Uppercase letters:= 2

-------------------------------------------------------

2. Write a Python program to generate a


random float where the value is between 5
and 50 using Python math module.

import random

random_float = random.uniform(9, 90)

You might also like