string = input("Enter the string: ")
string = string.strip()
word = string.split(" ")
symbols = list(word)
quantity = len(symbols)
if quantity < 3 or quantity > 3:
print("You entered less or more than 3 symbols, try again!")
else:
mult = 1
for k in word:
try:
mult *= int(k)
mult = abs(mult)
except ValueError:
print("You entered the letter!")
string = input("Enter the string: ")
print(mult)
prompt = 'введи 3 числа: '
while True:
try:
a, b, c = map(int, input(prompt).split())
print(a * b * c)
break
except ValueError:
prompt = 'экий ты тупой! введи 3 числа: '
from functools import reduce
from operator import mul
numbers = input('Введите 3 числа через пробел: ').split()
try:
numbers = list(map(int, numbers))
except ValueError:
print('Обнаружен недопустимый символ!')
else:
if len(numbers) == 3:
print('Результат перемножения чисел:', reduce(mul, numbers))
else:
print('Введено неверное количество чисел!')
mn = 1
while True:
numbers = input("Enter 11 numbers with a space: ").strip()
try:
numbers = list(map(int, numbers.split(" ")))
except ValueError:
print("You entered the letter!")
else:
if len(numbers) == 11:
for k in numbers:
mn *= k
print(abs(mn))
break
else:
print("You entered incorrect quantity of numbers! Try again!")