import itertools def fibonacci(n): a, b = 1, 1 yield a for _ in range(1, n): a, b = b, a+b yield a def nth_value(n): return next(itertools.islice(fibonacci(n), n-1, n)) print(nth_value(1500))
Standard input is empty
13551125668563101951636936867148408377786010712418497242133543153221487310873528750612259354035717265300373778814347320257699257082356550045349914102924249595997483982228699287527241931811325095099642447621242200209254439920196960465321438498305345893378932585393381539093549479296194800838145996187122583354898000