This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Write a program that receives from the user one string that represents | |
a product list for shopping, separated by commas without any spaces. | |
Example of an input string: "Milk, Cottage, Tomatoes". | |
The program asks the user to enter a number (digit) in one to nine ranges (no input validity is required). | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The function accepts two parameters: the first is a single character, the second is a maximum size. | |
The function returns a string representing an "arrow" structure (see example), which is built from the input character, | |
with the center of the arrow (the longest line) being the length of the size passed as a parameter. | |
Example of the arrow function run: | |
In this example, you pass the asterisk character * and the maximum size 5. That is, the middle row is 5 in length. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The function receives a list of tables in each item and its price. | |
The function returns a list of sorted tables based on the price of the items that are large to small. | |
Define the list of tables that the function gets the following: | |
[('Item', 'price'), ('item', 'price'), ('item', 'price')] | |
Notice that all organs are of the price string type written as a whole clown number. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The function accepts two parameters of the type Tuple as parameters. | |
The function returns a Tuple containing all the pairs that can be created from the passed-out Tuple organs. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The function accepts as a string list parameter, so that each string is one word (no spaces). | |
The function returns a list of the same strings passed, but as follows: | |
The list is divided into lists so that each "internal" list is composed of words that are one another's anagrams | |
(anagram: a word that consists of interweaving letters of another word, i.e. the same letters but in a different order). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Create a dictionary with a name of your choice and format it according to the following table: | |
first_name Mariah | |
last_name Carey | |
birth_date 27.03.1970 (string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The function accepts a string as a parameter. | |
The function returns a dictionary, so each organ in it is a key consisting of a key: | |
a character from the string passed (not including spaces), and an array: | |
the number of times the character appears in the string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
We are nearing the end of the courses and at this stage we are in contact. | |
The function accepts as a dictionary parameter. | |
The function returns a new dictionary with "Reverse" mapping: Each key in the transferred dictionary | |
is a value in the returned dictionary and each value in the transferred dictionary is a key in the returned dictionary. | |
Instructions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Write a program that receives from the user: | |
1. Path to Text File (String) | |
2. Name of one of the actions: rev, sort or last (string) | |
The file whose path is passed as an argument contains rows of word sequences in small English letters separated by a single space. | |
Depending on the user-recorded action the program performs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The function receives as parameters two strings representing file paths. | |
The function copies the contents of the source file to the destination file. | |
Example of an input file and running the copy_file_content function: |