-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask_second.py
More file actions
27 lines (24 loc) · 761 Bytes
/
task_second.py
File metadata and controls
27 lines (24 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
numbers = str(input())
t = list(numbers)
subsidiary = []
other_num = []
for i in range(len(numbers)):
if numbers[i] == ' ':
part = numbers[i+1:]
part_two = ''.join([str(m) for m in part])
for letter in part_two:
if letter == '?':
subsidiary.append(letter)
else:
other_num.append(letter)
if len(subsidiary) == 0:
print(1)
elif len(subsidiary) == 1 and len(other_num) == 0:
print(10)
elif len(subsidiary) == 1 and len(other_num) == 1:
print(9)
elif part[0] == '?' and len(subsidiary) > 1:
print(9 * (10 ** (len(subsidiary) - 1)))
else:
print(10 ** len(subsidiary))
i += 1