Serhiy Storchaka added the comment:
The implementation in the documentation is correct. Did you tested your
implementation?
The indentation of the "else" is correct. See
https://docs.python.org/3/reference/compound_stmts.html#the-for-statement
--
nosy: +serhiy.storchaka
resolution:
New submission from Sai Bhargava Ramu :
https://docs.python.org/2/library/itertools.html#itertools.combinations
#The behaviour of combinations function in documentation is different and I
think identation is missing with `else`
#I didn't get the logic right is point out anything further. This m