title: HOTS Question on Object Oriented Programming - Python
body: <ol>
  <li>I was solving a practice paper on coursera and i just can't solve this question can anyone help please?</li>
  <li>And apparently the topic of object oriented programming is optional in that course so is it not important or not useful enough??</li>
  </ol>
  <p>Here is the question:<br>
  &quot;The City class has the following attributes: name, country (where the city is located), elevation (measured in meters), and population (approximate, according to recent statistics). Fill in the blanks of the max_elevation_city function to return the name of the city and its country (separated by a comma), when comparing the 3 defined instances for a specified minimal population. For example, calling the function for a minimum population of 1 million: max_elevation_city(1000000) should return &quot;Sofia, Bulgaria&quot;.&quot;</p>
  <pre><code># define a basic city class
  class City:
      name = &quot;&quot;
      country = &quot;&quot;
      elevation = 0 
      population = 0
  
  # create a new instance of the City class and
  # define each attribute
  city1 = City()
  city1.name = &quot;Cusco&quot;
  city1.country = &quot;Peru&quot;
  city1.elevation = 3399
  city1.population = 358052
  
  # create a new instance of the City class and
  # define each attribute
  city2 = City()
  city2.name = &quot;Sofia&quot;
  city2.country = &quot;Bulgaria&quot;
  city2.elevation = 2290
  city2.population = 1241675
  
  # create a new instance of the City class and
  # define each attribute
  city3 = City()
  city3.name = &quot;Seoul&quot;
  city3.country = &quot;South Korea&quot;
  city3.elevation = 38
  city3.population = 9733509
  
  def max_elevation_city(min_population):
      # Initialize the variable that will hold 
  # the information of the city with 
  # the highest elevation 
      return_city = City()
  
      # Evaluate the 1st instance to meet the requirements:
      # does city #1 have at least min_population and
      # is its elevation the highest evaluated so far?
      if ___
          return_city = ___
      # Evaluate the 2nd instance to meet the requirements:
      # does city #2 have at least min_population and
      # is its elevation the highest evaluated so far?
      if ___
          return_city = ___
      # Evaluate the 3rd instance to meet the requirements:
      # does city #3 have at least min_population and
      # is its elevation the highest evaluated so far?
      if ___
          return_city = ___
  
      #Format the return string
      if return_city.name:
          return ___
      else:
          return &quot;&quot;
  
  print(max_elevation_city(100000)) # Should print &quot;Cusco, Peru&quot;
  print(max_elevation_city(1000000)) # Should print &quot;Sofia, Bulgaria&quot;
  print(max_elevation_city(10000000)) # Should print &quot;&quot;
  </code></pre>