iterables and iterators | HackerRank | Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • This video is about combinations from itertools in Python.
    Problem: www.hackerrank...
    Sample Code:
    from itertools import combinations
    n=int(input())
    l=list(input().split())
    k=int(input())
    c=list(combinations(l,k))
    print(c)
    r=[i for i in c if 'a' in i]
    print('%.3f'%(len(r)/len(c)))
    For 1 : 1 Tutoring
    WhatsApp contact : 7278222619
    mail: jaiswalsatya93@gmail.com
    You can support via UPI : sattujaiswal@okhdfcbank
    Follow us on:
    Whatsapp:
    chat.whatsapp....
    Facebook:
    / coderscart
    Linkedin:
    / satyendra-jaiswal-9035...
    Instagram:
    / codingcart
    #HackerRank #Python #programming

ความคิดเห็น • 7

  • @AbhishekKumar-ob7vh
    @AbhishekKumar-ob7vh 4 ปีที่แล้ว +3

    Nice explanation 👌

    • @codingcart
      @codingcart  4 ปีที่แล้ว

      Glad you liked it

  • @oyeniranolatunji9448
    @oyeniranolatunji9448 4 ปีที่แล้ว +2

    @coding cart
    Pls make a video on itertools permutations

    • @codingcart
      @codingcart  4 ปีที่แล้ว

      Sure..problem name??

  • @Cloudxxx23
    @Cloudxxx23 6 หลายเดือนก่อน

    0:30 thought in Python index starts at 0. Why 1?🤔😔

  • @parwathreddy421
    @parwathreddy421 3 ปีที่แล้ว

    solution not upto mark

    • @codingcart
      @codingcart  3 ปีที่แล้ว

      You can share your solution too so that others can take help 🙂.