Internship Mini Project
Internship Mini Project
import random
number = random.randint(1, 100)
guess = None
while guess != number:
guess = int(input("Guess a number between 1 and 100: "))
if guess < number:
print("Too low!")
elif guess > number:
print("Too high!")
else:
print("Correct!")
try:
weight = float(input("Enter your weight in kilograms (kg): "))
height = float(input("Enter your height in meters (m): "))
if height <= 0:
print("Height must be greater than zero.")
else:
bmi = weight / (height ** 2)
print(f"Your BMI is: {bmi:.2f}")
import random
choices = ['rock', 'paper', 'scissors']
user = input("Enter rock, paper, or scissors: ").lower()
computer = random.choice(choices)
print(f"Computer chose {computer}")
if user == computer:
print("It's a tie!")
elif (user == 'rock' and computer == 'scissors') or \
(user == 'scissors' and computer == 'paper') or \
(user == 'paper' and computer == 'rock'):
print("You win!")
else:
print("You lose!")
import time
seconds = int(input("Enter countdown time in seconds: "))
while seconds:
print(f"Time left: {seconds} sec")
time.sleep(1)
seconds -= 1
print("Time's up!")