numbers = range(1, 21) #Numbers from 1 to 20 inclusivedivisor = 6divisible = [num for num in numbers if num % divisor == 0]print(divisible)
Standard input is empty
[6, 12, 18]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!