For5. Given a real number - the price of 1 kg of sweets. Output the cost of 0.1, 0.2, ..., 1 kg of sweets.

Solution in Python 3:

import random

price = round(random.uniform(0, 100),2)
print('Price of 1 kg of sweets: ', price)
print()
for i in range(1,11):
x = 0.1*i
print('Cost of {0:.1f} kg: {1:.2f}'.format(x, x * price))
print()