Skip to content

Commit

Permalink
implement py-mutable-immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCyberf committed Dec 16, 2024
1 parent e67b5ea commit 9bf30d5
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,32 @@
}
collection_of_coins = {1, 2, 25}

# write your code here
sorted_variables = {}


def mutable_immutable(*args) -> dict:
mutable = []
immutable = []
for element in args:
if isinstance(element, (list, set, dict)):
mutable.append(element)
else:
immutable.append(element)

sorted_variables["mutable"] = mutable
sorted_variables["immutable"] = immutable

return sorted_variables


result = mutable_immutable(
lucky_number,
pi,
one_is_a_prime_number,
name,
my_favourite_films,
profile_info,
marks,
collection_of_coins,
)
print(result)

0 comments on commit 9bf30d5

Please sign in to comment.