Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jeet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jeet011@gmail.com
33 changes: 33 additions & 0 deletions jeet_issue_07.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
def binary_to_decimal(binary_str):
"""Convert binary string to decimal integer"""
try:
return int(binary_str, 2)
except ValueError:
return "❌ Invalid binary number!"


def decimal_to_binary(decimal_num):
"""Convert decimal integer to binary string"""
try:
return bin(int(decimal_num))[2:] # remove '0b' prefix
except ValueError:
return "❌ Invalid decimal number!"


# Main program
print("🔄 Binary ↔ Decimal Converter 🔄")
print("1️⃣ Binary → Decimal")
print("2️⃣ Decimal → Binary")

choice = input("Enter your choice (1 or 2): ")

if choice == '1':
binary = input("Enter a binary number: ")
print(f"Decimal: {binary_to_decimal(binary)}")

elif choice == '2':
decimal = input("Enter a decimal number: ")
print(f"Binary: {decimal_to_binary(decimal)}")

else:
print("❌ Invalid choice! Please enter 1 or 2.")
19 changes: 19 additions & 0 deletions jeet_issue_14.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import random

print("🎯 Welcome to the Number Guessing Game! 🎯")

# Generate a random number between 1 and 100
number = random.randint(1, 100)
attempts = 0

while True:
guess = int(input("Enter your guess (1-100): "))
attempts += 1

if guess < number:
print("📉 Too low! Try again.")
elif guess > number:
print("📈 Too high! Try again.")
else:
print(f"🎉 Congratulations! You guessed it in {attempts} attempts.")
break
9 changes: 9 additions & 0 deletions jeet_issue_19.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Leap Year Checker

year = int(input("Enter a year: "))

# Leap year conditions
if (year % 400 == 0) or (year % 100 != 0 and year % 4 == 0):
print(f"{year} is a leap year.")
else:
print(f"{year} is not a leap year.")
46 changes: 46 additions & 0 deletions jeet_issue_21.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Temperature Converter

def celsius_to_fahrenheit(c):
return (c * 9/5) + 32

def fahrenheit_to_celsius(f):
return (f - 32) * 5/9

def celsius_to_kelvin(c):
return c + 273.15

def kelvin_to_celsius(k):
return k - 273.15

def fahrenheit_to_kelvin(f):
return (f - 32) * 5/9 + 273.15

def kelvin_to_fahrenheit(k):
return (k - 273.15) * 9/5 + 32


print("=== Temperature Converter ===")
print("1. Celsius to Fahrenheit")
print("2. Fahrenheit to Celsius")
print("3. Celsius to Kelvin")
print("4. Kelvin to Celsius")
print("5. Fahrenheit to Kelvin")
print("6. Kelvin to Fahrenheit")

choice = int(input("\nEnter your choice (1-6): "))
temp = float(input("Enter temperature value: "))

if choice == 1:
print(f"{temp}°C = {celsius_to_fahrenheit(temp):.2f}°F")
elif choice == 2:
print(f"{temp}°F = {fahrenheit_to_celsius(temp):.2f}°C")
elif choice == 3:
print(f"{temp}°C = {celsius_to_kelvin(temp):.2f} K")
elif choice == 4:
print(f"{temp} K = {kelvin_to_celsius(temp):.2f}°C")
elif choice == 5:
print(f"{temp}°F = {fahrenheit_to_kelvin(temp):.2f} K")
elif choice == 6:
print(f"{temp} K = {kelvin_to_fahrenheit(temp):.2f}°F")
else:
print("Invalid choice! Please select a number between 1 and 6.")