Python Forum
Make one thing act like another
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make one thing act like another
#1
I have a long list of 750 single digit numbers.

WorldList = [0,0,3,7,3,2...]
I use the variable valIndex plus a number to call certain points in the list.

WorldList[valIndex + 30] = 0
I know that I could use an if statement every time I call a point, but could I make something at the top of my code that says "anywhere in the code where valIndex is a multiple of 30, set WorldList[valIndex+30] to 0"

so if I set valIndex to 60, then WorldList at 90 acts like 0. But as soon as valIndex changes, WorldList[90] goes back to what it was originally.

I know this is confusing and probably doesn't make sense.
Reply


Messages In This Thread
Make one thing act like another - by Zman350x - Aug-15-2018, 11:24 PM
RE: Make one thing act like another - by ichabod801 - Aug-16-2018, 12:50 AM
RE: Make one thing act like another - by perfringo - Aug-16-2018, 06:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I am confused with the key and value thing james1019 3 977 Feb-22-2023, 10:43 PM
Last Post: deanhystad
  Need help i just started the whole thing gabriel789 16 3,231 Sep-12-2022, 08:04 PM
Last Post: snippsat
  i making a terminal sign up website thing Kenrichppython 1 1,711 Nov-04-2021, 03:57 AM
Last Post: bowlofred
  use thing before self sylvanas 3 2,351 Jul-21-2021, 04:54 PM
Last Post: sylvanas
  Not able to make a specific thing pause in pygame cooImanreebro 4 3,230 Dec-13-2020, 10:34 PM
Last Post: cooImanreebro
  Help with list thing please Yeyzon 1 2,061 Apr-19-2019, 07:51 AM
Last Post: snippsat
  Printing one thing from a list bidoofis 1 2,352 Feb-05-2019, 09:02 PM
Last Post: ichabod801
  I found weird thing. catastrophe_K 1 2,104 Sep-29-2018, 09:59 AM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

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