This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# a = [] | |
# for i in range(1, 10+1): | |
# if i % 2 == 1: | |
# a.append(i*2) | |
# | |
# print (a) | |
# List comprehension type by python |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def get_natural_number(): | |
n = 0 | |
while True: | |
n += 1 | |
yield n | |