diff --git a/baishali_issue_19.py b/baishali_issue_19.py new file mode 100644 index 0000000..2bbec93 --- /dev/null +++ b/baishali_issue_19.py @@ -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.") diff --git a/baishali_issue_21.py b/baishali_issue_21.py new file mode 100644 index 0000000..3ca46cb --- /dev/null +++ b/baishali_issue_21.py @@ -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.") + \ No newline at end of file diff --git a/baishali_issue_6.css b/baishali_issue_6.css new file mode 100644 index 0000000..e69de29 diff --git a/baishali_issue_6.html b/baishali_issue_6.html new file mode 100644 index 0000000..e69de29 diff --git a/baishali_issue_9.py b/baishali_issue_9.py new file mode 100644 index 0000000..93c366e --- /dev/null +++ b/baishali_issue_9.py @@ -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}") \ No newline at end of file