Voltar à listaPython
Lantern Steps Sum
Lv.266@DevType ⌨️0 jogos27 de abr. de 2026
A lantern path has steps 1..n. Add odd steps normally, but even steps as squares. Print the glowing total for n=7.
preview.python
1n=72s=03for i in range(1,n+1):4 if i%2==0:s+=i*i5 else:s+=i6print(s)Problemas personalizados não são incluídos no ranking