Created
September 7, 2018 10:31
-
-
Save benslv/9fe9c2023404ab7a92eb07f43ad808a0 to your computer and use it in GitHub Desktop.
3. Less Than Ten
This file contains 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 = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] | |
for item in a: | |
if item < 5: | |
print(item) | |
b = [] | |
for item in a: | |
if item < 5: | |
b.append(item) | |
print(b) | |
print([i for i in a if i < 5]) | |
inpNumber = int(input("Please enter a number: ")) | |
print([i for i in a if i < inpNumber]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment