Answer:
#here is code in Python.
#read the value n from user
n=int(input("enter the value of n:"))
#variable to store the total sum
sum_n=0
for i in range(1,n+1):
# find the sum of series
sum_n=sum_n+1/i
#print the sum
print("sum of the series is: ",sum_n)
Explanation:
Read the value of n from user. Create and initialize a variable sum_n with 0. Run a for loop to calculate sum.Initially sum_n is 0, then for value of i=1 1/i will be added to the sum_n.Then in next iteration for i=1, 1/2 added to sum_n. Similarly loop will run util i equals to n.Then sum_n will store the sum of the
series.
Output:
enter the value of n:5
sum of the series is: 2.283333333333333
<em>Your answer is B: cooperative player-to-player interaction</em>
<em></em>
<em></em>
<em />
Answer:
num_guesses = 3 #initialized number of guesses to 3
user_guesses = [] #declared the user_guesses array
guess = 0 #guess variable initialized to 0
print('Enter a number: ') #prompt telling the user to enter a number
while guess < num_guesses: #loop capturing input and storing into array
num = int(input())
user_guesses.append(num)
guess = guess + 1
#end of loop
print(user_guesses) #array outputted to user
Explanation:
The above program captures numbers from the user and stores into an array (user_guesses), the length of the array is determined by the value contained in the num_guesses variable, it prints the combined input as an array.