Can anyone please tell the python program for this..
pls do as soon as possible
Share
Can anyone please tell the python program for this..
pls do as soon as possible
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
series_1 = lambda x, n: sum([x ** j for j in range(1, n + 1)])
series_2 = lambda x, n: sum([x ** j / j for j in range(1, n + 1)])
x, n = list(map(int, input("enter x & n: ").split()))
print("\n".join([f"series_1: {series_1(x, n)}", f"series_2: {series_2(x, n):.2f}"]))