Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dates = [1982, 1980, 1973, 2000]
- for date in dates: # Iterates through dates list item by item until reaching 1973
- if date == 1973:
- break # Exits loop upon finding 1973 value
- else:
- print(date)
- counter = 0
- year = 0 # Initialize year value
- while year != 1973: # Begins conditional loop
- print(dates[counter]) # Uses the counter as an index to print our indexed value in dates list
- year = dates[counter] # Sets the year value to the current indexed value in the dates list
- counter += 1 # Advances the index 1 value per iteration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement