1)
a=int(input())
k=4
suma=0
while k<a:
suma+=1/k
k+=1
print(round(suma,4))
2)
k=1000
n=0
while k!=9999:
l=list(str(k))
if l[2]==l[3]:
n+=1
print(n)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
1)
a=int(input())
k=4
suma=0
while k<a:
suma+=1/k
k+=1
print(round(suma,4))
2)
k=1000
n=0
suma=0
while k!=9999:
l=list(str(k))
if l[2]==l[3]:
n+=1
k+=1
print(n)