Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class state:
- pass
- # Enter the data
- state_values_1991 = []
- s = state()
- s.name = "Missouri"
- s.cost = 1500
- state_values_1991.append(s)
- s = state()
- s.name = "Arkansas"
- s.cost = 1200
- state_values_1991.append(s)
- s = state()
- s.name = "Illinois"
- s.cost = 1700
- state_values_1991.append(s)
- # Set the threshold
- cost_threshold = 1350
- # Find states above threshold
- for state in state_values_1991:
- state.above_threshold = 0 # make this the default
- if state.cost > cost_threshold:
- state.above_threshold = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement