items = [(1000, 2), (5000, 1)] pay = 0 for i in range(items[0][1]): pay += items[0][0] for j in range(items[1][1]): pay += items[1][0] print(pay)
To embed this project on your website, copy the following code and paste it into your website's HTML: