Skip to content

Instantly share code, notes, and snippets.

"""
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.
"""
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.
"""
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.
"""
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).
"""
The function gets a string and deletes the letters that appear in sequence. That is,
the function returns a string containing only one character from each sequence of identical characters in the input string.
>>> sequence_del("ppyyyyythhhhhooonnnnn")
'python'
>>> sequence_del("SSSSsssshhhh")
""" The function gets an integer, end_number.
The function returns a list within the numbers 0 through the end_number,
with some numbers being replaced by a boom string if they meet one of the following conditions:
1. The number is double the number 7.
2. The number contains the digit 7."""
EXMP:
print(seven_boom(17))
"""
The function accepts as a string parameter.
The function returns a list in which the first organ represents the number of digits in the string,
and the second organ represents the number of letters in the string, including spaces, points,
"""
The function accepts two parameters: list and number n.
The function returns a new list containing all organs larger than the number n.
"""
The function receives two integers, start and stop (suppose it exists: start <= stop).
The function returns a list where all the number squares are between start and stop (inclusive).
Instructions
Use the while loop only.
"""
The function receives a list consisting of strings and returns the longest string.