Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add_nuage_word(word=[]):
- word.append("Nuage")
- return word
- if __name__ == '__main__':
- a = add_nuage_word()
- b = add_nuage_word()
- print(" ".join(a+b) == "Nuage Nuage") # True
- prices = {'apple': 0.40, 'banana': 0.50}
- my_purchase = {
- 'apple': 1,
- 'banana': 6}
- def grocery_bill():
- my_purchase = dict(my_purchase.items() + {'apple': 2}.items())
- return sum(prices[fruit] * my_purchase[fruit]
- for fruit in my_purchase)
- if __name__ == '__main__':
- print(grocery_bill())
- def power_generator():
- return [(lambda x: x ** i) for i in range(5)]
- if __name__ == '__main__':
- for power in power_generator():
- print(power(2)) # expected output: 2^0 2^1 2^2 2^3 2^4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement