Coding Exercise for Beginners in Python with solution | Exercise 25 | Python for Beginners

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 35

  • @MVAbhi-fe3zr
    @MVAbhi-fe3zr Рік тому +17

    Our Andhra students scoring well in python, our faculties worrying about other languages... please teach other languages too....

  • @vandainff7485
    @vandainff7485 Рік тому +10

    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 ")

  • @syed7835
    @syed7835 Рік тому

    i have 5 year experience of software development parr ajj bhi tumhariii khoobsoorti daikhnai kai liyai sirf tumhari videos daikhta ha . True fan

  • @cyberpunk_.21
    @cyberpunk_.21 Рік тому +1

    Mind blowing Ma'am

  • @MyCodingDiary
    @MyCodingDiary Рік тому +1

    Your videos are a great resource for anyone learning to code. Thank you for creating it!❣

  • @saurav_biswas7
    @saurav_biswas7 Рік тому +2

    i=0
    while i>>1,2,3,loop complete
    My Qe is Why out of loop print statement is executed with end=??

    • @eternaltraphd9584
      @eternaltraphd9584 Рік тому +1

      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.

    • @saurav_biswas7
      @saurav_biswas7 Рік тому

      @@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..

  • @bhavanisankar7588
    @bhavanisankar7588 Рік тому +1

    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😃😃

  • @cyberpunk_.21
    @cyberpunk_.21 Рік тому

    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 .

  • @edgelord45
    @edgelord45 Рік тому +1

    love😍

  • @AnirudhKumar-l7r
    @AnirudhKumar-l7r Рік тому

    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)

  • @chinenyeumeaku9262
    @chinenyeumeaku9262 Рік тому

    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}")

  • @ramanyadav3185
    @ramanyadav3185 Рік тому +1

    thanks mam for ur appriciable efforts for us ........LOVE FROM REWARI (HARYANA)❤❤❤

  • @jahnavikalluru4681
    @jahnavikalluru4681 Рік тому

    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)

  • @nickranjan8206
    @nickranjan8206 Рік тому

    Wow madam 😍😍😍,soo easy. I understand everything 😊. Please make tough lecture 🙏, tough questions

  • @sidharthkaruvarath2532
    @sidharthkaruvarath2532 Місяць тому

    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!!')

  • @phanivarma5656
    @phanivarma5656 Рік тому

    U made my day mam

  • @ALL_ROUNDER973
    @ALL_ROUNDER973 Рік тому +2

    Mam ur done one crime mam uknown please answer me mam🥰🥰🥰

  • @syed7835
    @syed7835 Рік тому

    Love u from BahawalPur

  • @tayyabusman8159
    @tayyabusman8159 8 місяців тому

    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())

  • @sunil6398
    @sunil6398 Рік тому

    love from nepal mam

  • @robinx0471
    @robinx0471 Рік тому

    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))

  • @Sivalakshmi_Music
    @Sivalakshmi_Music Рік тому

    Madam please upload Java programming course video's

  • @sanjay_sanju06
    @sanjay_sanju06 Рік тому +1

    Madam can you help us slove hackerrank python solutions

  • @رينشاد_أ
    @رينشاد_أ 7 місяців тому

    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())

  • @Mulla-alyusufi
    @Mulla-alyusufi Рік тому

    Please complete C++

  • @vizagridersclub.2525
    @vizagridersclub.2525 Рік тому

    How can I reach you

  • @Mulla-alyusufi
    @Mulla-alyusufi Рік тому

    We are waiting you C++

  • @bhiks
    @bhiks Рік тому

    Mam😢 you forget c++ series 😢😢😢😢😢

  • @syed7835
    @syed7835 Рік тому

    yaar tum kitni cute hoo

  • @TT_NOTHING
    @TT_NOTHING Рік тому

    Madam your to beautiful

  • @AshishVerma-hl9il
    @AshishVerma-hl9il Рік тому

    Jenny Bhabhi, Data science series shuru kariye