mirror of
https://github.com/Asabeneh/30-Days-Of-Python.git
synced 2026-06-12 21:01:48 +08:00
Edit Functions and Higher order functions
This commit is contained in:
parent
ff24ab221f
commit
b24a8ffdf0
@ -404,7 +404,7 @@ print(reverse_list1(["A", "B", "C"]))
|
||||
food_staff = ['Potato', 'Tomato', 'Mango', 'Milk'];
|
||||
print(add_item(food_staff, 'Meat')) # ['Potato', 'Tomato', 'Mango', 'Milk','Meat'];
|
||||
numbers = [2, 3, 7, 9];
|
||||
print(add_item(numbers, 5)) [2, 3, 7, 9, 5]
|
||||
print(add_item(numbers, 5)) # [2, 3, 7, 9, 5]
|
||||
```
|
||||
|
||||
12. Declare a function named remove_item. It takes a list and an item parameters. It returns a list with the item removed from it.
|
||||
|
||||
@ -201,7 +201,7 @@ def decorator_with_parameters(function):
|
||||
@decorator_with_parameters
|
||||
def print_full_name(first_name, last_name, country):
|
||||
print("I am {} {}. I love to teach.".format(
|
||||
first_name, last_name, country))
|
||||
first_name, last_name))
|
||||
|
||||
print_full_name("Asabeneh", "Yetayeh",'Finland')
|
||||
```
|
||||
|
||||
Loading…
Reference in New Issue
Block a user