>>> manila_pop = 1780148 >>> manila_area = 16.56 >>> manila_pop_density = manila_pop/manila_area >>> print(int(manila_pop_density)) 107496
bool
>>> 1 < 2 True >>> 42 > 43 False
sf_population, sf_area = 864816, 231.89 rio_population, rio_area = 6453682, 486.5 san_francisco_pop_density = sf_population/sf_area rio_de_janeiro_pop_density = rio_population/rio_area print(san_francisco_pop_density > rio_de_janeiro_pop_density)
string
>>> print("hello") hello >>> print('hello') hello >>> welcome_message = "Hello, welcome to Tokyo" >>> print(welcome_message) Hello, welcome to Tokyo >>> instructor_1 = "Philip" >>> instructor_2 = "Charlie" >>> print(instructor_1 + " and " + instructor_2) Philip and Charlie
messiah = 'He\'s not the Messiah, he\'s a very naughty boy!' print(messiah) username = "Kinari" timestamp = "04:50" url = "http://petshop.com/pets/mammals/cats" print(username + " accessed the site " + url + " at " + timestamp)
len
>>> tokyo_length = len("Tokyo")
>>> print(tokyo_length)
5given_name = "Charlotte"
middle_names = "Hippopotamus"
family_name = "Turner"name_length = len(given_name+middle_names+family_name)
driving_licence_character_limit = 28
print(name_length <= driving_licence_character_limit) [/python]