Python Special Programs - Separating Even & Odd Numbers

Поделиться
HTML-код
  • Опубликовано: 3 янв 2025

Комментарии • 7

  • @IQ170plus
    @IQ170plus 6 дней назад

    We code this without append 😊😊😊😊
    n=list(map(int,input('enter a number = ').split()))
    even=[]
    odd=[]
    for val in n:
    if val%2==0:
    even=even+[val]
    else:
    odd=odd+[val]
    print(even)
    print(odd)

  • @tayyab.sheikh
    @tayyab.sheikh 6 месяцев назад +1

    real = []
    print ('Enter some numbers in the list: (press "-1" to exit)')
    while True:
    x = int(input())
    if x == -1:
    break
    real.append(x)
    even_nums = []
    odd_nums = []
    for num in real:
    if num % 2 == 0:
    even_nums.append(num)
    else:
    odd_nums.append(num)
    print ('Even Numbers: ')
    print (even_nums)
    print ('Odd Numbers: ')
    print (odd_nums)

  • @hadideyal9377
    @hadideyal9377 Год назад

    T'hanks sir

  • @UsmanAliAli-od7eg
    @UsmanAliAli-od7eg Год назад

    Thanks you dear jaspreet sing sir from Pakistan and long live for jaspreet sing sir from 🇵🇰🇵🇰❤❤

  • @PeddammaSrilatha
    @PeddammaSrilatha Год назад

    Sir,could you please teach the my sql its a request. I searched many websites but not satisfied can't able to get the content up to the mark .So I heard about you that the way you teach is very excellent and can able to content in a good way . So its a request to teach the my sql

  • @tommcruise.
    @tommcruise. Год назад

    Is course is completed or not?

  • @walida4151
    @walida4151 11 месяцев назад

    li = list(range(1,25))
    evenNumbers = []
    oddNumbers = []
    for i in li:
    if i % 2 == 0:
    evenNumbers.append(i)
    else:
    oddNumbers.append(i)
    print(evenNumbers)
    print()
    print(oddNumbers)