Given 4 lines of text, you need to parse it and perform data operations to fit the requirement.
You may need this code to read the lines and keep values in the list:
import sys
words = []
for line in sys.stdin.readlines():
words.append(line.strip())You may also need the function round() to limit the digit numbers of float.
An example is shown below.
>>> print(round(5.123456, 1))
5.14 lines of text with the following syntax:
e1
e2
e3
e4
where e1, ... , e4 represented 4 elements from given text.
A line of text with the following operations:
e1 multiply e2 plus e4 multiply e3
Note that the details of the operations are: