Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """ User should specify the start number and end number for a range of
- whole numbers """
- lower_bound = int(input("Enter the start point: ")) # The start point
- upper_bound = int(input("Enter the end point (n - 1): ")) # The end point - 1
- # The only_odds function declaration
- def only_odds(lower, upper):
- print(list(filter(lambda number: number % 2 == 1, range(lower, upper))))
- # The only_odds function invocation
- only_odds(lower_bound, upper_bound)
- # Enter the start point: 1
- # Enter the end point (n - 1): 9
- # [1, 3, 5, 7]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement