Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
little exercise
#5
still didnt find,
i only know it has to start with:
for i, number in enumerate(my_list): (exo starts with that, so i must use it)

sorry for double post.
I just tried :
for i, number in enumerate(my_list):
       print my_list[i] - my_list[i-1]]
my output is :

Output:
-44 1 2 2 15 24
but i want it to be :

Output:
1 1 2 2 15 24
Reply


Messages In This Thread
little exercise - by haye - Sep-20-2017, 04:31 PM
RE: little exercise - by buran - Sep-20-2017, 04:39 PM
RE: little exercise - by haye - Sep-20-2017, 04:45 PM
RE: little exercise - by buran - Sep-20-2017, 05:56 PM
RE: little exercise - by haye - Sep-21-2017, 09:37 AM
RE: little exercise - by buran - Sep-21-2017, 09:51 AM
RE: little exercise - by haye - Sep-21-2017, 09:55 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020