Answer:import functools
# open your file
file = open("integers.txt", 'r')
file = file.read()
# put numbers into a list
file = file.split()
# convert list into integers
file = list(map(int, file))
# use lambda function to get average.
print(functools.reduce(lambda x, y: x+y / len(file), file, 0))
Explanation:
Answer:
A computer is an electronic device that manipulates information, or data. It has the ability to store, retrieve, and process data. You may already know that you can use a computer to type documents, send email, play games, and browse the Web
Explanation:
Follow me..............
Chocolate is now a sweet treat that is very popular in the us
Answer:
Well, I guess you could use a special representation of the function through a sum of terms, also known as Taylor Series.
It is, basically, what happens in your pocket calculator when you evaluate, for example,
sin
(
30
°
)
.
Your calculator does this:
sin
(
θ
)
=
θ
−
θ
3
3
!
+
θ
5
5
!
−
...
where
θ
must be in RADIANS.
In theory you should add infinite terms but, depending upon the accuracy required, you can normally stop at three terms.
In our case we have:
θ
=
π
6
=
3.14
6
=
0.523
and:
sin
(
π
6
)
=
sin
(
0.523
)
=
0.523
−
0.024
+
3.26
⋅
10
−
4
−
...
=
0.499
≈
0.5
Explanation: