def l(year): if year%400==0: return True elif year%100==0: return False elif year%4==0: return True return False year=int(input(" enter an year ")) month=int(input(" enter a month ")) if l(year): if month%2==1: print(" number of days are 31 ") elif month==2: print(" number of days are 29 ") elif month%2==0: print(" number of days are 30 ") else: if month%2==1: print(" number of days are 31 ") elif month==2: print(" number of days are 28 ") elif month%2==0: print(" number of days are 30 ")
As print('loop completed') is out of the loop, so after ending the iterations of the loop, the control will go to next statement which is print. So the print statement is executed. It is not inside the loop because it is being printed only 1 time.
@@eternaltraphd9584 i know the print statement (loop complete) is out of loop.. so it should be print like.. >>>1,2,3 loop complete But the print statement executed with end=' ' parameter in loop..
def leap_year(year): if (year%4==0 and year%100!=0) or (year%4==0 and year%100==0 and year%400==0): return True else: return False year=int(input()) month=int(input()) days=[31,28,31,30,31,30,31,31,30,31,30,31] if leap_year(year) and month==2: print("29") else: print(days[month-1]) This my understanding medam😃😃
Ma'am this video so much help me . This coding exercise session is so much help full. You are so awesome Ma'am . And u are so humble and intelligent . Ma'am u are a beauty with mind .
import calendar year=int(input("enter the year: ")) month=int(input("enter the month: ")) def days(year,month): for month in range(1,13): if year%4==0: if year%100==0: if year%400==0: return "leap" else: return "no leap" else: return "leap" else: return "no leap" days_in_month = calendar.monthrange(year,month)[1] result = days_in_month print(days_in_month)
def leapyear(year): if year % 4 == 0 and year % 100 != 0: return True elif year % 4 == 0 and year % 100 == 0: if year % 400 == 0: return True else: return False else: return False def manydays(year, month): if month == 2: if leapyear(year) == True: return 29 else: return 28 dict1 = {1:31, 3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31} if month in dict1: return dict1[month] while True: year = int(input("Enter year: ")) if len(str(year)) == 4: break else: print("Enter valid year") while True: month = int(input("Enter digits for month: ")) if month < 0 or month > 12: print("Enter valid month") else: break result = manydays(year, month) print(f"Number of days in {month}/{year} is {result}")
a=int(input('enter the year: ')) b=int(input('enter the month number: ')) def leap_year(num): if num%4==0: if num%100==0: if num%400==0: return 'leap year' else: return 'leap year' else: return 'normal year' year=leap_year(a) def result(Y,M): if Y=='leap year' and M==2: print('This month contains 29 days.') elif Y=='normal year' and M==2: print('This month contains 28 days') elif M==1 or M==3 or M==5 or M==7 or M==8 or M==10 or M==12: print('This month contains 31 days') elif M==4 or M==6 or M==9 or M==11: print('This month contains 30 days') result(year,b)
year= int(input("Please enter the year: ")) month= int(input('Please enter the month: ')) if month ==2: if (year %4)==0: if (year % 100)==0: if (year% 400)==0: print("29 Days!!") else: print("28 days!!") else: print("29 Days!!") else: print("28 days!!") elif month == 1 or month ==3 or month ==5 or month ==7 or month ==8 or month ==10 or month ==12: print("31 days!!") elif month== 4 or month== 6 or month== 9 or month == 11: print("30 days!!") else: print('Invalid entry!') print('Thank you!!')
if index == 'sep' or index == 'apr' or index == 'jun' or index == 'nov': return (f"{index.title()} has 30 Days.") elif index == 'feb': year = int(input("Enter year to check for leap or not: ")) if year % 4== 0 and year % 100 != 0 or year % 400 == 0: return (f"{index.title()} has 29 Days.") else: return (f"{index.title()} has 28 Days.")
return else: return (f"{index} has 31 Days.") print(month_days())
def month_checker(years, day): days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] if years % 4 == 0 and years % 100 != 0: days[1] = 29 else: if years % 400 == 0: days[1] = 29 else: days[1] = 28 if day == 0: return "Please Enter a Valid Month" return f"The selected month including '{days [day-1]}' days" year = int(input("Enter a year :")) month = int(input("Enter a month 1-12 you want to know about the days :")) print(month_checker(year, month))
dict_month = { 1 : 'januvary', 2 : 'febuvary', 3 : 'march', 4 : 'april', 5 : 'may', 6 : 'june', 7 : 'july', 8 : 'august', 9 : 'spetember', 10 : 'october', 11 : 'november', 12 : 'december' } def leap(year): # 1= leap year 2= not leap year if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: return (1, f'{year}') else: return (2, f'{year}') else: return (1, f'{year}') else: return (2, f'{year}') def user(): year = int(input('enter a year: ')) leap_checker = leap(year) month = int(input('enter month(1-12): ')) day_list = [31,28,31,30,31,30,31,31,30,31,30,31] if leap_checker[0] == 1: #leap year if month == 1 or month in range(3,13): return (f'{leap_checker[1]} is leap year and {dict_month[month]} has {day_list[month-1]} days') if month == 2: return (f'{leap_checker[1]} is leap year and {dict_month[month]} has 29 days') if leap_checker[0] == 2: #non leap year if month == 1 or month in range(3,13): return (f"{leap_checker[1]} isn't leap year and {dict_month[month]} has {day_list[month-1]} days") if month == 2: return (f"{leap_checker[1]} isn't leap year and {dict_month[month]} has 28 days") print(user())
Our Andhra students scoring well in python, our faculties worrying about other languages... please teach other languages too....
def l(year):
if year%400==0:
return True
elif year%100==0:
return False
elif year%4==0:
return True
return False
year=int(input(" enter an year "))
month=int(input(" enter a month "))
if l(year):
if month%2==1:
print(" number of days are 31 ")
elif month==2:
print(" number of days are 29 ")
elif month%2==0:
print(" number of days are 30 ")
else:
if month%2==1:
print(" number of days are 31 ")
elif month==2:
print(" number of days are 28 ")
elif month%2==0:
print(" number of days are 30 ")
Bro give condition in if statement..
i have 5 year experience of software development parr ajj bhi tumhariii khoobsoorti daikhnai kai liyai sirf tumhari videos daikhta ha . True fan
Mind blowing Ma'am
Your videos are a great resource for anyone learning to code. Thank you for creating it!❣
i=0
while i>>1,2,3,loop complete
My Qe is Why out of loop print statement is executed with end=??
As print('loop completed') is out of the loop, so after ending the iterations of the loop, the control will go to next statement which is print. So the print statement is executed. It is not inside the loop because it is being printed only 1 time.
@@eternaltraphd9584 i know the print statement (loop complete) is out of loop.. so it should be print like..
>>>1,2,3
loop complete
But the print statement executed with end=' ' parameter in loop..
def leap_year(year):
if (year%4==0 and year%100!=0) or (year%4==0 and year%100==0 and year%400==0):
return True
else:
return False
year=int(input())
month=int(input())
days=[31,28,31,30,31,30,31,31,30,31,30,31]
if leap_year(year) and month==2:
print("29")
else:
print(days[month-1])
This my understanding medam😃😃
Ma'am this video so much help me . This coding exercise session is so much help full. You are so awesome Ma'am . And u are so humble and intelligent .
Ma'am u are a beauty with mind .
love😍
import calendar
year=int(input("enter the year: "))
month=int(input("enter the month: "))
def days(year,month):
for month in range(1,13):
if year%4==0:
if year%100==0:
if year%400==0:
return "leap"
else:
return "no leap"
else:
return "leap"
else:
return "no leap"
days_in_month = calendar.monthrange(year,month)[1]
result = days_in_month
print(days_in_month)
def leapyear(year):
if year % 4 == 0 and year % 100 != 0:
return True
elif year % 4 == 0 and year % 100 == 0:
if year % 400 == 0:
return True
else:
return False
else:
return False
def manydays(year, month):
if month == 2:
if leapyear(year) == True:
return 29
else:
return 28
dict1 = {1:31, 3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}
if month in dict1:
return dict1[month]
while True:
year = int(input("Enter year: "))
if len(str(year)) == 4:
break
else:
print("Enter valid year")
while True:
month = int(input("Enter digits for month: "))
if month < 0 or month > 12:
print("Enter valid month")
else:
break
result = manydays(year, month)
print(f"Number of days in {month}/{year} is {result}")
thanks mam for ur appriciable efforts for us ........LOVE FROM REWARI (HARYANA)❤❤❤
a=int(input('enter the year: '))
b=int(input('enter the month number: '))
def leap_year(num):
if num%4==0:
if num%100==0:
if num%400==0:
return 'leap year'
else:
return 'leap year'
else:
return 'normal year'
year=leap_year(a)
def result(Y,M):
if Y=='leap year' and M==2:
print('This month contains 29 days.')
elif Y=='normal year' and M==2:
print('This month contains 28 days')
elif M==1 or M==3 or M==5 or M==7 or M==8 or M==10 or M==12:
print('This month contains 31 days')
elif M==4 or M==6 or M==9 or M==11:
print('This month contains 30 days')
result(year,b)
Wow madam 😍😍😍,soo easy. I understand everything 😊. Please make tough lecture 🙏, tough questions
year= int(input("Please enter the year: "))
month= int(input('Please enter the month: '))
if month ==2:
if (year %4)==0:
if (year % 100)==0:
if (year% 400)==0:
print("29 Days!!")
else:
print("28 days!!")
else:
print("29 Days!!")
else:
print("28 days!!")
elif month == 1 or month ==3 or month ==5 or month ==7 or month ==8 or month ==10 or month ==12:
print("31 days!!")
elif month== 4 or month== 6 or month== 9 or month == 11:
print("30 days!!")
else:
print('Invalid entry!')
print('Thank you!!')
U made my day mam
Mam ur done one crime mam uknown please answer me mam🥰🥰🥰
Love u from BahawalPur
def month_days():
index = (input("Enter month: ")).lower()
if index == 'sep' or index == 'apr' or index == 'jun' or index == 'nov':
return (f"{index.title()} has 30 Days.")
elif index == 'feb':
year = int(input("Enter year to check for leap or not: "))
if year % 4== 0 and year % 100 != 0 or year % 400 == 0:
return (f"{index.title()} has 29 Days.")
else: return (f"{index.title()} has 28 Days.")
return
else:
return (f"{index} has 31 Days.")
print(month_days())
love from nepal mam
def month_checker(years, day):
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if years % 4 == 0 and years % 100 != 0:
days[1] = 29
else:
if years % 400 == 0:
days[1] = 29
else:
days[1] = 28
if day == 0:
return "Please Enter a Valid Month"
return f"The selected month including '{days [day-1]}' days"
year = int(input("Enter a year :"))
month = int(input("Enter a month 1-12 you want to know about the days :"))
print(month_checker(year, month))
Madam please upload Java programming course video's
Madam can you help us slove hackerrank python solutions
dict_month = {
1 : 'januvary',
2 : 'febuvary',
3 : 'march',
4 : 'april',
5 : 'may',
6 : 'june',
7 : 'july',
8 : 'august',
9 : 'spetember',
10 : 'october',
11 : 'november',
12 : 'december'
}
def leap(year): # 1= leap year 2= not leap year
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
return (1, f'{year}')
else:
return (2, f'{year}')
else:
return (1, f'{year}')
else:
return (2, f'{year}')
def user():
year = int(input('enter a year: '))
leap_checker = leap(year)
month = int(input('enter month(1-12): '))
day_list = [31,28,31,30,31,30,31,31,30,31,30,31]
if leap_checker[0] == 1: #leap year
if month == 1 or month in range(3,13):
return (f'{leap_checker[1]} is leap year and {dict_month[month]} has {day_list[month-1]} days')
if month == 2:
return (f'{leap_checker[1]} is leap year and {dict_month[month]} has 29 days')
if leap_checker[0] == 2: #non leap year
if month == 1 or month in range(3,13):
return (f"{leap_checker[1]} isn't leap year and {dict_month[month]} has {day_list[month-1]} days")
if month == 2:
return (f"{leap_checker[1]} isn't leap year and {dict_month[month]} has 28 days")
print(user())
Please complete C++
How can I reach you
We are waiting you C++
Mam😢 you forget c++ series 😢😢😢😢😢
yaar tum kitni cute hoo
Madam your to beautiful
You're right. Jenny is quite an eyeful.
Jenny Bhabhi, Data science series shuru kariye