[Solved] How to sum random two numbers?


You need to create a function and then return the output of the addition. A function which takes two arguments.

def addition(number1, number2):
    return number1 + number2

number1 and number2 are the 2 arguments. Since you already have 2 numbers in your list you can pass them like this.

print(addition(*randomlist))

The * unpacks the items in your list and passes them as seperate variables.

I would suggest doing some reading on python functions

solved How to sum random two numbers?