1)
n = int(input())
s = 1
k = 2
while k <= n:
s += (1/k)
k += 1
print(s)
2)
m = int(input())
if n < m:
print('n =',(n+m)/2)
print('m =',(n+m)*2)
else:
print('m =',(n+m)/2)
print('n =',(n+m)*2)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
1)
n = int(input())
s = 1
k = 2
while k <= n:
s += (1/k)
k += 1
print(s)
2)
n = int(input())
m = int(input())
if n < m:
print('n =',(n+m)/2)
print('m =',(n+m)*2)
else:
print('m =',(n+m)/2)
print('n =',(n+m)*2)