0
Why i cant solve this??
Una computadora comienza imprimiendo los números 1, 2 y 3 Luego continua imprimiendo sin parar la suma de los últimos 3 números que imprimio 6. 11. 20. 37 68 Cuales son los últimos 4 digitos del número impreso en la posición 20202020202020T02 Por ejemplo en la posición 30 esta impreso el numero 45152016 que termina en 2016
3 Réponses
+ 2
You can try the following code!
(puedes probar este código
solo ingrese la posición del número)
integ = int(input("Position of number? : "))
a = [1,2,3]
for i in range(integ-3):
num = a[i] + a[i+1] + a[i+2]
a.append(num)
end = str(a[-1])
print(end[-4:])
+ 1
✳AsterisK✳
I think sometimes showing a working code helps a lot. I think by seeing a working code you can see how different your code is from that, how much better/worse or faster/slower your code is and also alternative (sometimes better) way of doing same thing. I have also learnt like this and always see some other user's 'code bits'. I get to learn a lot like this and also some interesting approach to the same output/solution. The above is my personal opinion and it might be different for others.
0
it will be probably best if you show your code so that users can help you fix it, Utkarsh Sharma showing the OP a working code won’t help the OP learn