SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. numPasses = 5
  2. numUses = 3
  3. x = 0
  4. y = 0
  5. storage = [1, 2, 3, 4, 5]
  6.  
  7.  
  8. #data driven
  9. def printArrayElements(x, storage):
  10.     print("Pass: " + str(x) + " is: " + str(storage[x]))
  11.  
  12.  
  13. while(x != numPasses):
  14.     printArrayElements(x, storage)
  15.     #print("Pass: " + str(x) + " is: " + str(storage[x]))
  16.     x = x + 1
  17.  
  18.  
  19. #Code driven
  20. while y < numPasses:
  21.  
  22.     if(y == 0):
  23.         print(storage[0])
  24.     if(y == 1):
  25.         print(storage[1])
  26.     if(y == 2):
  27.         print(storage[2])
  28.     if(y == 3):
  29.         print(storage[3])
  30.     if(y == 4):
  31.         print(storage[4])
  32.    
  33.     y = y + 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top