Create a function that inverts the rgb values of a given tuple.
color_invert((255, 255, 255)) ➞ (0, 0, 0)
# (255, 255, 255) is the color white.
# The opposite is (0, 0, 0), which is black.Create a function that takes a list of numbers, a string and return a list of numbers as per the following rules:
"Asc" returns a sorted list in ascending order (ex. 1 2 3)
"Des" returns a sorted list in descending order (ex. 3 2 1)
"None" returns a list without any modification
I'm trying to watch some lectures to study for my next exam but I keep getting distracted by meme compilations, TikTok, anime, and more.
Your job is to help me create a function that takes a string and checks to see if it contains the following words or phrases:
"anime"
"meme"
"tiktoks"
"roasts"In this challenge, you have to convert a weight weighed on a planet of the Solar System to the corresponding weight on another planet.
To convert the weight, you have to divide it by the gravitational force of the planet on which it is weighed and multiply the result (the mass) with the gravitational force of the other planet. See the table below for a list of gravitational forces:
weight on planet_a / gravitational force of planet_a * gravitational force of planet_b
Planet m/s²
Mercury 3.7
Write a function that takes a list of multiple lists and returns one list that is made up of all the lists in the original list. Put another way you need to flatten a 2d list.
list_builder([[1, 2], [3, 4]]) ➞ [1, 2, 3, 4]
list_builder([["a", "b"], ["c", "d"]]) ➞ ["a", "b", "c", "d"]