Skip to content

Instantly share code, notes, and snippets.

"""
The function receives two lists containing organs of the type int and float alone.
The function returns true if both lists contain exactly those people (even if in different order),
otherwise the function returns false.
"""
The function accepts two lists list_y, list_x. The function extends list_x (modifies it) so that at the beginning
it also contains list_y, and returns list_x.
"""
The function gets a list of strings of equal length. The function returns a string containing the list organs in paired positions,
violated in the Warford comma, as well as the last limb with the caption and before.
"""
Write a function called shift_left. The function accepts a list of 3 lengths and returns a new list one step to the left.
>>> shift_left([0, 1, 2])
[1, 2, 0]
>>> shift_left(['monkey', 2.0, 1])
choice = int(input())
10
if choice == 1:
print("You've chosen one")
str = input("Please enter a string:")
# ddar astronaut. pldase, stop drasing md!
a = str[1:-1]
all_but_first = a.replace("d","e")
print(all_but_first)
string = input("Please enter a string:")
# spaceships
middle = len(string)//2
first_half = string [0:middle]
second_half = string [middle:]
"""
Write a program that receives a string from the user and prints 'OK' if it is Plindrome, otherwise 'NOT'.
Instructions
Plindrome is a string (word, number, or any sequence of characters) whose right-to-left reading is the same as reading from left to right. pay attention:
No small or large letters are important.
"""
Write a function called last_early
The function accepts as a string parameter. The function returns True if the last character that appears in the string also appears earlier. Otherwise the function returns False.
Instructions
"""
Write a function called distance
The function receives three integers: num1, num2, num3.
The function returns True if both conditions are met:
1. One of the numbers num2 or num3 is "close" to num1. "Close" = absolute distance 1.