-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (34 loc) · 1.05 KB
/
main.py
File metadata and controls
38 lines (34 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
lucky_number = 777
pi = 3.14
one_is_a_prime_number = False
name = "Richard"
my_favourite_films = [
"The Shawshank Redemption",
"The Lord of the Rings: The Return of the King",
"Pulp Fiction",
"The Good, the Bad and the Ugly",
"The Matrix",
]
profile_info = ("michel", "michel@gmail.com", "12345678")
marks = {
"John": 4,
"Sergio": 3,
}
collection_of_coins = {1, 2, 25}
def sort_variables(*args) -> dict:
results = {}
mutable = []
immutable = []
for argument in args:
if callable(argument) or isinstance(argument, (list, set, dict)) or (
isinstance(argument, tuple)
and any(isinstance(i, (list, set, dict)) for i in argument)
):
mutable.append(argument)
else:
immutable.append(argument)
results["mutable"] = mutable
results["immutable"] = immutable
return results
sorted_variables = sort_variables(lucky_number, pi, one_is_a_prime_number, name, my_favourite_films,
profile_info, marks, collection_of_coins)