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
6 changes: 6 additions & 0 deletions baishali_issue_19.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# program to check leap year
year = int(input("Enter a year: "))
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
print(f"{year} is a leap year.")
else:
print(f"{year} is not a leap year.")
13 changes: 13 additions & 0 deletions baishali_issue_21.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# temperature converter issue 21
unit=input("Is this temperature in Celsius or Fahrenheit? (C/F): ")
temp= float(input("Enter the temperature you want to convert: "))
if unit=="C":
converted_temp= (temp * 9/5) + 32
print(f"{temp} degree Celsius is equal to {converted_temp} degree Fahrenheit.")

elif unit=="F":
converted_temp= (temp - 32) * 5/9
print(f"{temp} degree Fahrenheit is equal to {converted_temp} degree Celsius.")
else:
print("Invalid unit. Please enter 'C' for Celsius or 'F' for Fahrenheit.")

Empty file added baishali_issue_6.css
Empty file.
Empty file added baishali_issue_6.html
Empty file.
23 changes: 23 additions & 0 deletions baishali_issue_9.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# program to swap two numbers
#using temporary variable
a=int(input("Enter first number: "))
b=int(input("Enter second number: "))
print(f"Before swapping: a ={a}, b ={b}")
temp=a
a=b
b=temp
print(f"After swapping: a ={a}, b ={b}")
#without using temporary variable
a=int(input("Enter first number: "))
b=int(input("Enter second number: "))
print(f"Before swapping: a ={a}, b ={b}")
a=a+b
b=a-b
a=a-b
print(f"After swapping: a ={a}, b ={b}")
#using python's special feature
a=int(input("Enter first number: "))
b=int(input("Enter second number: "))
print(f"Before swapping: a ={a}, b ={b}")
a,b=b,a
print(f"After swapping: a ={a}, b ={b}")