Collections in Python
1. Create a random list of 9 elements. Perform the following actions with it:
- add -1 to the end of the list
- add the list elements [-2, -8, -5, -7] to the end of the list
- add 9 as the third element
- count the number of three random numbers (from the list) in the list
- determine the index of the element -5 in the list
- check if -2, -10 are in the list
- sort the list
- reverse the sorted list
2. Create two sets (with 3-5 elements each). One - with a list of items you would gather in case of a zombie apocalypse.
The second - a list of items you would take to the sea.
Example (but feel free to add something of your own):
zombies_are_comming = {'water', 'first aid kit', 'radio', 'flashlight', 'snacks'}
pina_colada_is_waiting = {'swimsuit', 'sunglasses', 'flipflops', 'water', 'snacks'}
Obtain and output the following sets:
- Everything necessary for survival in a zombie apocalypse on the southern coast of Spain (one set + another)
- Items that will help you survive in the apocalypse but will not be useful in the Maldives (if we believe the created sets) (what is in one list and does not appear in the other)
- A list of items needed for both events at the same time - after all, we need to understand what will be in the highest demand next summer (intersection of the sets)
- We did not keep track of the demand, items necessary for both events at the same time have already been taken 😔 Output what remains (symmetric difference)
3. Create an empty dictionary. Insert the following 3 elements into it:
"Inception": {"director": "Christopher Nolan", "year": 2010, "genre": "Sci-Fi"}
"Titanic": {"director": "James Cameron", "year": 1997, "genre": "Romance/Drama"}
"The Matrix": {"director": "Lana Wachowski", "year": 1999, "genre": "Sci-Fi"}
- Output information about Inception. Anticipate the possibility that this element is not in the dictionary (if not, an appropriate message should be displayed)
- Output all movie titles.
- Remove Titanic from the dictionary.
4. You have a list of friends (3-5 people). You sit down to play Battleship (only 2 players per game). Output all possible pairs of combatants. (For three friends, the list will be 1 and 2, 1 and 3, 2 and 3)
5. A marker is simultaneously one of three colors (red, blue, green) and one of three types (professional, children's, office). Output all possible markers.
6. You have a list of friends (3-5 people). You sit down to play Uno (playing in a circle). Output all pairs of who plays with whom (consecutive overlapping pairs taken from the input iterable).
Example:
Players: A, B, C, D
Combinations: AB, BC, CD, DA
Hint: the keyword here is "consecutive pairs"
🟣 7. Create a Counter object from a list of 100 random numbers.
- Output the 2 objects that occur most frequently and how many times they occur
- Remove from the Counter the information about the most frequently occurring element
- Create another list of 10 numbers and update the Counter object with this new list.
🟣 8. Create a deque list from the list [10]
Sequentially generate 10 digits (range from 0 to 20) and add to the list at the beginning (if the number is less than 10) and at the end (if greater than or equal to 10)
Example:
For the sequence 1, 15, 9, 22, 10, 8, 22 the resulting list should look like 8, 9, 1, 10, 15, 22, 10, 22.
Client's review of cooperation with Andrii Panichuk
Collections in PythonI am very satisfied with the result! Everything is done excellently, all requirements and deadlines have been met. I recommend this specialist!
Freelancer's review of cooperation with Yevhen Inchevsky
Collections in PythonThank you for the project!
I am ready to work more!
-
711 4 0 Hello, I am ready to complete it within the day. There is nothing complicated.
-
1300 25 0 Hello. I propose collaboration. I have reviewed your tasks and am ready to complete all of them. Write to me privately, we will discuss options for interaction.
-
1301 25 1 Good day! I have familiarized myself with all your programming tasks in Python and can offer my assistance in their implementation. I have sufficient experience in programming in Python and am ready to take on the tasks.
-
105 Good evening, as far as I understand, it is necessary to complete these 8 tasks, I can solve them. I will describe comments to the lines of code about what is done and where for direct visibility.
-
601 6 0 Good evening, I can do it during the night. The only thing I would like to clarify is 1 detail in a private message.
-
3140 52 1 Good day
I will do it
I will do it
I will do it
Write to me, we will discuss
I am ready to do it
-
2947 73 4 2 Good day! I have experience = I can do it!!!!!!!!!! Feel free to contact me!!!!
Current freelance projects in the category Databases & SQL
Refinement of 1C UT 11 for Zebra TSD (RDP): different sound signals when scanning
22 USD
Configuration: 1C UT 11 Address warehouse Zebra TC26 TSD Work via RDP Product scanning is performed in receiving, placement, picking documents, and other warehouse operations. Current problem: Warehouse workers operate through the Zebra TSD. When scanning, they do not always… C#, Databases & SQL ∙ 1 day 8 hours back ∙ 5 proposals |
Heal the 1C configuration
111 USD
Configuration of CRM & ERP SmartCeiling (2.8.26.0) Protection via Registration Code. Registered until the end of the year. Databases & SQL ∙ 1 day 23 hours back ∙ 8 proposals |
Need a 1C specialist for refinements and development.I am looking for a 1C specialist for freelance collaboration. I am currently working with a contractor who provides support and maintenance for the 1C system. However, due to the contractor's workload, there is a need for prompt execution of additional tasks, improvements, and… Databases & SQL ∙ 6 days 22 hours back ∙ 12 proposals |
Restoring Instagram after a banOn March 3, 2026, my Instagram was blocked due to a violation of rules. I believe there has been some mistake, as the page was personal with photos and videos of my personal trips. I did not post any comments anywhere. I have sent several appeals. I cannot download my files… Databases & SQL, Web Programming ∙ 7 days 9 hours back ∙ 6 proposals |
Eliminate the issue of incomplete data import from Excel files of Nova Poshta specifications into 1C:
45 USD
Goal: There is a processing in 1C for uploading the specifications of Nova Poshta. For unclear reasons, it has stopped loading some tabular data. We need to find the reason and eliminate the problem of incomplete data import from Excel files of Nova Poshta specifications into… System & Network Administration, Databases & SQL ∙ 10 days 16 hours back ∙ 16 proposals |