write a python code: including: Boolean, while and for loop, Functions,files, list and tuple, string,Classes and objecte

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

write a python code: including: Boolean, while and for loop, Functions,files, list and tuple, string,Classes and objecte

Post by answerhappygod »

Write A Python Code Including Boolean While And For Loop Functions Files List And Tuple String Classes And Objecte 1
Write A Python Code Including Boolean While And For Loop Functions Files List And Tuple String Classes And Objecte 1 (36.22 KiB) Viewed 26 times
Leap Year: A year is called a leap year if it contains an additional day which makes the number of the days in that year is 366. This additional day is sold in February which makes it 29 days long. A leap year occurred once every 4 years, Design a program that asks the user if he/she wants to check a year, if he/she enters Y or y let him her enter a year numbet. The program should contain Function (leap_check) to check if leap year or not. You should follow the following steps to determine whether a year is a leap year or not. 1. If a year is evenly divisible by 4 means having no remainder then go to next step. If it is not divisible by 4. It is not a leap year. For example: 1997 is not a leap year. 2. If a year is divisible by 4, but not by 100. For example: 2012, it is a leap year. If a year is divisible by both 4 and 100, go to next step. 3. If a year is divisible by 100, but not by 400. For example: 1900, then it is not a leap year. If a year is divisible by both, then it is a leap year So 2000 is a leap year. The program should save the result in the file (leapyear.txt)

ojects/pythonProject/sheet 4 (02).py* Do oad // Download once // Don't show again // Configure... (5/15/2022 12:18 AM 1:16 CRF UTF-4 spaces than 3.7 222 AM 29°C do 0 ENS 5/18/2022 IM! EL Caps Lock AWEI SN Sample input/output: DI FE Leap Year Checker This program will check if a year you input is a leap year Would you like to check a year?(Enter y for yes and any key for No): Y Enter a year: 1997 1997 is not a leap year 8 8 V U Would you like to check another year?(Enter y for yes and any key for No): Y Enter a year: 2012 2012 is a leap year Would you like to check another year?(Enter y for yes ( and any key for No): Y Enter a year: 1900 1900 is not a leap year 1 Would you like to check another year?(Enter y for yes and any key for No): Y Enter a year: 2000 2000 is a leap year Would you like to check another year? (Enter y for yes and any key for No): N leapyear.txt file: Year Type 1997 not a leap year 2012 a leap year 1900 not a leap year 2000 a leap year
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply