Professional Documents
Culture Documents
Output:
Output:
Enter First Number: 10
Enter Second Number: 5
Sum of the Two Number 15
Difference of the Two Numbers 5
Multiplication of the Two Numbers 50
Division of the Two Numbers 2.0
Department Of MCA 1
Mini project with IOT Lab
print("Enter a sentence")
sentence=input()
words=sentence.split()
word_count=0
character_count=0 for word in
words: word_count+=1
character_count+=len(word)
print("Total numbers of words in the sentence are:",word_count)
print("Total numbers of characters in the sentence excluding spaces are:",character_count)
print("Total numbers of characters in the sentence including spaces
are:",character_count+word_count-1)
Output:
Enter a sentence
Iam fine
Total numbers of words in the sentence are: 2
Total numbers of characters in the sentence excluding spaces are: 7
Total numbers of characters in the sentence including spaces are: 8
continue
elif(choice=='4'):
Department Of MCA 2
Mini project with IOT Lab
break
else:
print("please enter a valid number from the menu")
continue
print("Thank you")
Output:
***************
Select the Shape to calculate Area
1.Rectangle 2.Triangle
3.Circle 4.Exit
1
Enter the width of the rectangle in meters
20
Enter the height of the rectangle in meters
21
The area of a given rectangle is 420 square meters
***************
Select the Shape to calculate Area
1.Rectangle 2.Triangle
3.Circle 4.Exit
2
Enter the base width of the triangle in meters
12
Enter the height of the triangle in meters
5
The area of a given triangle is 30.0 square meters
***************
Select the Shape to calculate Area
1.Rectangle 2.Triangle
3.Circle 4.Exit
3
Enter the radius of the circle in meters
24
the area of a given circle is 1808.6399999999999 square meters
***************
Select the Shape to calculate Area
1.Rectangle 2.Triangle
3.Circle 4.Exit
10
please enter a valid number from the menu ***************
Select the Shape to calculate Area
1.Rectangle 2.Triangle
3.Circle 4.Exit
Department Of MCA 3
Mini project with IOT Lab
Department Of MCA 4