Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''Multiply Maximazer
- Get 4 numbers as an input. Split into two double digits number that generates the maximum number
- when they are multiplied by each other
- '''
- def Multiply_Max(numbers):
- '''Sort the list reverse. Use indexing and make two double digits numbers a,b.
- The biggest number and the smallest number should be accompanied wheareas, middle 2 numbers should also be accompanied
- In order to calculate a*b, both a, b should be integers. change all the indexed to int.
- '''
- numbers.sort(reverse=True)
- a = int(numbers[0])*10 + int(numbers[3])
- b = int(numbers[1])*10 + int(numbers[2])
- return (a*b)
- #num is a list of input
- num = list(input("Please enter 4 digits of number:"))
- print("Maximum number is:", Multiply_Max(num))
Add Comment
Please, Sign In to add comment