Advertisement
Cobble5tone

Educational - calling variable in class

Aug 27th, 2019
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. class County:
  2.     def __init__(self, init_name, init_population, init_voters):
  3.         self.name = init_name
  4.         self.population = init_population
  5.         self.voters = init_voters
  6.  
  7. a = County('washington', 10000, 90000)
  8.  
  9. print(a.voters / a.population)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement