if otvet2 == "округление":
print(" Хорошо, тогда скажи, в какую сторону мне округлить твое число. В большую или меньшюю.")
storona = input(" Если тебе надо округлить число в большую сторону, то напиши okrb, если в меньшюю okrm: ")
storona = None
if otvet2 == "округление":
print(" Хорошо, тогда скажи, в какую сторону мне округлить твое число. В большую или меньшюю.")
storona = input(" Если тебе надо округлить число в большую сторону, то напиши okrb, если в меньшюю okrm: ")
import re
def to_seconds(instr: str) -> int:
FORMAT = {
'\D?(\d+)s': lambda x: x,
'\D?(\d+)m': lambda x: 60 * x,
'\D?(\d+)h': lambda x: 60 * 60 * x,
'\D?(\d+)d': lambda x: 24 * 60 * 60 * x,
'\D?(\d+)w': lambda x: 7 * 24 * 60 * 60 * x,
}
outstr = 0
for key in FORMAT:
if re.search(key, instr):
outstr += FORMAT[key](int(re.search(key, instr).group(1)))
return outstr
str1 = "3w3d12h12m40s"
print(to_seconds(str1))
Two sets are equal if and only if every element of each set is contained in the other (each is a subset of the other). A set is less than another set if and only if the first set is a proper subset of the second set (is a subset, but is not equal). A set is greater than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal).
If multiple items are minimal, the function returns the first one encountered.