Yahoo Web Search

Search results

  1. Top results related to is 1492 a leap year python

  2. 1 day ago · 0. I am new to Python and was creating a Python program to check if a year is a leap year or not. year = int (input ()) if year % 4 == 0 and (year % 100 == 0 and year % 400) == 0: print (f" {year} is a leap year.") else: print (f" {year} is not a leap year.") I created this but not sure if this will work for all use cases or not.

  3. 4 days ago · def is_year_leap(year): if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): return True return False test_data = [1900, 2000, 2016, 1987] test_results = [False, True, True, False] for i in range(len(test_data)): year = test_data[i] print(f"{year} -> ", end="") result = is_year_leap(year) if result == test_results[i]: print("OK") else ...

  4. www.w3schools.com › python › python_datetimePython Dates - W3Schools

    1 day ago · Date Output. When we execute the code from the example above the result will be: 2024-06-01 10:06:56.285496. The date contains year, month, day, hour, minute, second, and microsecond. The datetime module has many methods to return information about the date object. Here are a few examples, you will learn more about them later in this chapter:

    Code sample

    import datetime
    x = datetime.datetime(2020, 5, 17)
    print(x)...
  5. 4 days ago · Python Program to Check Whether the Year is a Leap or Not y= int(input("Enter any year: ")) if y%4==0: if y%100: if y%400==0: print("It is a leap year") else: print("It is not a leap year") else: print("It is a leap year") else: print("It is not a leap year")

  6. 2 days ago · In those cases, we can use the datetime () class constructor of the Python datetime module. This Python datetime () class constructor requires three parameters to create a date, that is, year, month, and day. Example: import datetime. a = datetime(2050,11,11) print(a) Output: 2050-11-11.

  7. 2 days ago · 11/26/23, 4:53 AM Basic Python Program - Jupyter Notebook Program 11 Write a Python Program to Check if a Number is Positive, Negative or Zero. In [12]: 1 num = float (input ("Enter a number: ")) 2 if num > O: 3 print ("Positive number") 4 elif num == 5 print ("Zero") 6 else: 7 print ("Negative number™) Enter a number: 6.4 Positive number ...

  8. 3 days ago · In 1492 significant events took place in Africa as a continent. In West Africa, the Empire of Songhai was in its inception. The founder of the Songhai Empire Sunni Ali died in 1492 but during his regime, he dismounted the Mali Empire, which made him the greatest conquering King West Africa had ever seen.

  1. People also search for