Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def only_odds(list1):
- x = [] #create and empty list
- for i in list1: #loop through the elements in list1
- if i%2 == 1: #if any of the elements in list1 is odd
- x.append(i) #add the object to a new list
- print(x) #print x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement