Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- #get the integers
- high = int(input('Enter the high integer for the range '))
- low = int(input('Enter the low integer for the range '))
- multi = int(input('Enter the integer for the multiples '))
- #call the function
- multiples = show_multiples(low, high, multi)
- #print the multipes
- print(multiples)
- #take the arguments into the function
- def show_multiples(low, high, multi):
- #set counter
- counter = 0
- #create list
- results = []
- #set loop
- keepgoing = True
- while keepgoing == True:
- #add to counter each pass
- counter += 1
- #math to get multiples
- result = multi * counter
- #high side stop
- if result >= high:
- keepgoing = False
- #cut the list and sort it
- results[low:high]
- results.sort(reverse=True)
- else:
- keepgoing = True
- return (result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement