+1 vote
Write a program to compute 1/2+2/3+3/4+...+n/n+1 with a given n input by console (n>0).

Example: If the following n is given as input to the program: 5

Then, the output of the program should be: 3.55 Dec 21, 2019 in Python 207 views

## 1 answer to this question.

+1 vote
num = int(input("Enter a number: "))
newnum = 0

for each in range(1,num+1):
newnum = newnum+(each/(each+1))

print("computed value : ",format(round(newnum,2))) answered Dec 27, 2019 by
• 160 points

## how to print array integer without [] bracket in python like result = 1,2,3,4,5

Hey @abhijmr.143, you can print array integers ...READ MORE

+1 vote

## Write a for loop that prints all elements of a list and their position in the list. a = [4,7,3,2,5,9]

Try using this question by list comprehension: a=[4,7,3,2,5,9] print([x for ...READ MORE

## Create 3*4 array of random numbers - Python

To create different arrays like random arrays:  np.random.rand(3,4) ...READ MORE

## How do I create 3 X 4 array of random numbers between 0 and 100 using python?

Use numpy in the following manner: np.random.rand(3,4)*100 When you ...READ MORE

## What is the meaning of “int(a[::-1])” in Python?

Assumming a is a string. The Slice ...READ MORE

## How is Python 2.7.3 and Python 3.3 different?

raw_input() is not used in Python 3. Use input()  ...READ MORE

## Python 3 equivalent of SimpleHTTPServer

The SimpleHTTPServer module has been merged into ...READ MORE