Answer the question
In order to leave comments, you need to log in
What is the syntax error here (Python)?
Start = int(input("Начало: "))
End = int(input("Конец: "))
Yes = int(input("Входит: "))
No = int(input("Не входит: "))
Opt = int(input("Количество операций: "))
f = Yes == No
A = [0] * (End - Start + 1)
B = []
for i in range(1, Opt + 1):
s = input("Операция √" + str(i) + " (+* & Значение")
B +=
// тут
def G(n):
if n == Start:
return 1
elif n > Start:
summ = 0
for i in B:
if i[0] == '+':
summ += G(n - int(i[1]))
elif i[0] == '*' and n % int(i[1]) == 0:
summ += G(n // int(i[1]))
return summ
return 0
print(G(End))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question