I'm trying to work through my first Python program (I just began taking a class for Python a month or so ago). Right now, I'm only allowed to use the standard library, but I can import the random library as well.
What I'm trying to do is compare two lists. One, is a list of random numbers (which I already have figured out) and the second one is a list of 1's and 0's. 1 meaning that the number in the first list needs to be replaced with a new random number. 0 Meaning they want to keep that number.
Could someone help me out and kind of explain their logic through it? I'm at a loss right now, and would really appreciate any help you could give me.
Here's what I have so far:
def replaceValues(distList, indexList):
for i in range (1,len(indexList)):
if indexList[i] = int(1):
Then I get kind of lost.
Thanks!