Skip to content

kalanithisuryah-web/Python-Assignment-3-While-Loop-For-loop-and-Functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Python-Assignment-3-While-Loop-For-loop-and-Functions

1️⃣ Number Guessing Game: Uses while loop with break, continue, and else. A random number (1–10) is generated and the user gets 3 attempts to guess it. If the guess is out of range, continue is used. If guessed correctly, break ends the loop. The else block displays “Better luck next time!” if all attempts are used.

2️⃣Multiplication Table (For Loop): User enters a number, and a for loop (1–10) prints the multiplication table in the format num x i = result.

3️⃣ BMI Calculator (Function): A function calculate_bmi(weight, height) returns BMI using the formula weight / height². User inputs weight and height, and the program prints the calculated BMI.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published