Python lists outside of range -


how can move forward item in list past range? example, if set alarm @ 2pm , want go off in 59 hours, time be?

i code this, fails past range of 25:

time = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24) print(time[15+59]) 

this has nothing python, modular arithmetic:

print(time[(14 - 1 + 59) % 24]) 

prints

1 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -