Largest city

Report a typo

One way to compare different cities is to compare their population. You've created a class City and objects of this class have parameters name and population.

Define the __init__ method and __gt__ method that would compare two cities based on their population.

Tip: The function __gt__ should only return the result of the comparison operator it represents, no need for any calculations.

Write a program in Python 3
class City:
# define methods here
___

Create a free account to access the full topic