CYB/130 Week 2 Python LAB 3.14: Simple statistics

$ 8

CYB/130 Week 2 Python LAB 3.14: Simple statistics
Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their average as integers (rounded), then as floating-point numbers.

Output each rounded integer using the following:
print(‘{:.0f}’.format(your_value))

Output each floating-point value with three digits after the decimal point, which can be achieved as follows:
print(‘{:.3f}’.format(your_value))

Ex: If the input is:
8.3
10.4
5.0
4.8
the output is:
2072 7
2071.680 7.125

907 in stock

SKU: CYB130WK2LAB3P14 Categories: ,

Description

CYB/130 Week 2 Python LAB 3.14: Simple statistics
Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their average as integers (rounded), then as floating-point numbers.

Output each rounded integer using the following:
print(‘{:.0f}’.format(your_value))

Output each floating-point value with three digits after the decimal point, which can be achieved as follows:
print(‘{:.3f}’.format(your_value))

Ex: If the input is:
8.3
10.4
5.0
4.8
the output is:
2072 7
2071.680 7.125

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.