⊗pyPmIBMNO 177 of 208 menu

Mathematical Operations with Numbers in Python

sum math.fsum math.factorial

Given a list:

lst = [1, 2, 3, 4, 5]

Find the sum of the elements of this list.

Given a set:

st = {2.3, 4, 7.8}

Find the sum of the elements of this list as a fractional number.

Two numbers are given:

num1 = 2 num2 = 15

Generate a random integer from the range given by our numbers. Then get its factorial.

Given a list:

lst = [1, 2, 3, 4, 5]

Find the arithmetic mean of this list.

byenru