Python Forum
Python Looping Gurus, question for you,...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Looping Gurus, question for you,...
#6
Further question if I could,...

If I have this tuple:
('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten')
and I want to accomplish three things,
  1. list the tuple elements down a column starting with A1 and ending with A10,
  2. have the number-iteration in A1 to A10 replace the '#' placeholder in this code:
    sheet['A#'].value = 'tuple-element'
  3. have the tuple element iterate through and replace the 'tuple-element' placeholder in this same code:
    sheet['A#'].value = 'tuple-element'

how would I accomplish this?
If possible, could you point me in the direction using simple loops instead of f-strings? I'm still learning loops and I'm challenged with the older, simpler style right now.

I've been working on it and I'm stuck with this consistent result
{"sheet['A1'].value = ''": 'one', "sheet['A10'].value = ''": 'ten', etc.
So I have the A1-A10 numbering working.
I'm having trouble inserting the tuple element in between the quotations in this part of the code
value = ''
Thanks,
Phil
Reply


Messages In This Thread
RE: Python Looping Gurus, question for you,... - by pcsailor - Sep-19-2018, 06:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Looping a question until correct feedback is given TylerTrunzo 9 1,871 Oct-31-2022, 12:19 PM
Last Post: rob101
  Virtual Assistant code is looping back in python ShishirModi 1 2,539 Oct-13-2020, 08:04 AM
Last Post: Nickd12

Forum Jump:

User Panel Messages

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