Skip to content

Instantly share code, notes, and snippets.

View H3lllfir3's full-sized avatar
🏠
Working from home

H3llf!r3 H3lllfir3

🏠
Working from home
View GitHub Profile
@H3lllfir3
H3lllfir3 / .py
Last active November 5, 2019 19:44
List Comprehension
>>> numbers = [ num for num in range(10)]
>>> numbers
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> numbers = [ num for num in range(10) if num % 2 == 0]
>>> numbers
[0, 2, 4, 6, 8]
>>> names = [ input() for i in range(2)]
reza
ayoub
>>> names