Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

# Printing the welcome game screen
print ("HANGMAN_ASCII_ART", """
_ _
| | | |
| |__| | __ _ _ __ __ _ _ __ ___ __ _ _ __
| __ |/ _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
| | | | (_| | | | | (_| | | | | | | (_| | | | |
|_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
__/ |
|__ _/""")
"""
The function accepts as parameters:
1. Path to File (String).
Just as in the previous exercise, the file represents a playlist of songs and has a fixed format built from the song name, performer name (singer / band), and song length, separated by semicolon (;) without spaces.
"""
The function accepts as a path parameter to the file (string).
The file represents a playlist of songs and has a fixed format built from the song name, performer name (singer / band) and song length, separated by semicolon (;) without spaces.
An example of an input file called songs.txt:
"""
The function accepts as a path parameter for a text file (string).
The path whose path is passed as an argument contains a list of integers from 1 to n that are not sorted, comma separated, with one of the numbers in the sequence disappearing (i.e. missing from the sorted list).
Who_is_missing function operation:
A. The function returns the missing number in sequence (int).
B. The function writes the missing number in succession to a new file called found.txt.
"""
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:
"""
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:
"""
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:
"""
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.
"""
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)
"""
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).