def wolf_sight_direction(food_amount): wolf_attraction_chance = 0 * food_amount if wolf_attraction_chance == 0 and food_amount == 0: print "No food. Wolf looks towards the forest" else: print food_amount, "food given. Wolf still looks towards the forest" for food_amount in range(42): wolf_sight_direction(food_amount) food_amount += 1
def in_at(): forehead = True spelt = True return forehead and spelt print in_at()
def wisdom(hair): return 42 - len(hair) print wisdom("Very long and curly blond haired specimen") print wisdom("Vasserman")
class War: def __init__(self): self.definition = "KillThemAll" class Happiness: pass class Kitten: pass class Beauty: pass class WarChild(War): pass print issubclass(Happiness, War) print issubclass(Kitten, War) print issubclass(Beauty, War) print issubclass(WarChild, War)
import time timestamp = int(time.time()) if timestamp > 1488326399: pants = 2 else: pants = 1 print pants
Source: https://habr.com/ru/post/318680/
All Articles