Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

No loop is necessary:

all(el <= c for el in L)
click to hide/show revision 2
No.2 Revision

No explicit loop is necessary:necessary. If L is the list and c is the particular number, then you can do:

all(el <= c for el in L)
click to hide/show revision 3
No.3 Revision

No explicit loop is necessary. necessary; you can use a generator expression in combination with all. If L is the list and c is the particular number, then you can do:

all(el <= c for el in L)