Nth term of GP | Python | Castor Classes

preview_player
Показать описание
Code:

a=int(input('Enter the first term'));
b=int(input('Enter the second term'));
N=int(input('Enter the n value')); # 2 4 8 16 32
r=b/a;
s=a*r**(N-1);
print(s);

Prerequisite:
Power of a number | Python | Castor Classes

Python for beginners:

#GP #CastorClasses #Python
Рекомендации по теме
join shbcf.ru