Skip to content

Instantly share code, notes, and snippets.

@KatiGithub
Created June 20, 2018 09:17
Show Gist options
  • Save KatiGithub/fed36c70e6c0d41f8872e69004eac011 to your computer and use it in GitHub Desktop.
Save KatiGithub/fed36c70e6c0d41f8872e69004eac011 to your computer and use it in GitHub Desktop.
This code asks for an input and then tells you numbers less than that on the list.
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
num = int(input("Choose a number from 1 to 10: "))
new_list = []
for i in x:
if i < num:
new_list.append(i)
print(new_list)
#You can increase te number on the array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment