Python Forum
flipping the for loop in file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
flipping the for loop in file
#3
>>> left, right = 'x[1][2]=5'.split('][')
>>> left, right = left[:-1] + right[0], left[-1] + right[1:]
>>> new_line = ']['.join((left, right))
>>> new_line
'x[2][1]=5'
>>> 
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
flipping the for loop in file - by juniorcoder - Oct-21-2018, 09:41 AM
RE: flipping the for loop in file - by ichabod801 - Oct-21-2018, 01:22 PM
RE: flipping the for loop in file - by wavic - Oct-21-2018, 01:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Flipping matrices problem Qmohankumar0017 10 9,210 Feb-20-2019, 06:47 PM
Last Post: buran

Forum Jump:

User Panel Messages

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