Python Forum
Multiplicate several numbers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiplicate several numbers
#5
(Oct-05-2018, 08:40 AM)Student0 Wrote: Thanks for answer, but it didnt work :/
Do you have other suggestions? :)

[Image: kCqm92f]
Well, the code by nilamo:
import functools
import operator

def func(x):
    return 1 + (1/(x**2))

print(functools.reduce(operator.mul, map(func, range(1, 19))))
worked for me.

Output:
3.482783207792457
I am trying to help you, really, even if it doesn't always seem that way
Reply


Messages In This Thread
Multiplicate several numbers - by Student0 - Oct-04-2018, 09:13 PM
RE: Multiplicate several numbers - by nilamo - Oct-04-2018, 09:34 PM
RE: Multiplicate several numbers - by Student0 - Oct-05-2018, 08:40 AM
RE: Multiplicate several numbers - by gruntfutuk - Oct-05-2018, 09:41 AM
RE: Multiplicate several numbers - by nilamo - Oct-09-2018, 05:35 PM
RE: Multiplicate several numbers - by buran - Oct-05-2018, 08:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 3,771 May-09-2019, 12:19 PM
Last Post: Pleiades

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020