Professional Documents
Culture Documents
Snakify Answers
Snakify Answers
Snakify Answers
To find a desired problem, press control+F and type the problem
name.
Section 1
1.1 – Sum of three numbers
a = int(input())
b = int(input())
c = int(input())
print(a + b + c)
1.2 – Hi John
name = input()
print('Hi', name)
1.3 – Square
a = int(input())
print(a ** 2)
a = int(input())
b = int(input())
print(a * b / 2)
n = int(input())
k = int(input())
https://snakifyanswers.wordpress.com 1/9
25-02-2024 12:35 Snakify Answers
print(k // n)
print(k % n)
n = int(input())
print(‘The next number for the number ‘ + str(n) + ‘ is ‘ + str(n + 1) + ‘.’)
print(‘The previous number for the number ‘ + str(n) + ‘ is ‘ + str(n – 1) + ‘.’)
hours_1 = int(input())
minutes_1 = int(input())
seconds_1 = int(input())
hours_2 = int(input())
minutes_2 = int(input())
seconds_2 = int(input())
print(hours_2 * 3600 + minutes_2 * 60 + seconds_2
- hours_1 * 3600 - minutes_1 * 60 - seconds_1
a = int(input())
b = int(input())
c = int(input())
print(a // 2 + b // 2 + c // 2 + a % 2 + b % 2 + c % 2)
Section 2
2.1 – Last digit of integer
a = int(input())
print(a % 10)
https://snakifyanswers.wordpress.com 2/9
25-02-2024 12:35 Snakify Answers
a = int(input())
print(a // 10, a % 10)
a = int(input())
tens = a // 10
units = a % 10
print(units * 10 + tens)
print(int(input()) % 100)
n = int(input())
print(n // 10 % 10)
https://snakifyanswers.wordpress.com 3/9
25-02-2024 12:35 Snakify Answers
n = int(input())
a = n // 100
b = n // 10 % 10
c = n % 10
print(a + b + c)
my_number = int(input())
print(str(my_number)[::-1])
num0 = int(input())
num1 = int(input())
print(str(num0)[0]+str(num1)[0]+str(num0)[1]+str(num1)[1])
a = int(input())
print(a % 100 * 100 + a // 100)
x = float(input())
print(x - int(x))
x = float(input())
print(int(x * 10) % 10)
n = int(input())
m = int(input())
print(ceil(m / n))
https://snakifyanswers.wordpress.com 4/9
25-02-2024 12:35 Snakify Answers
k = int(input())
print((k + 3) % 7)
n = int(input())
hours = n // 60
minutes = n % 60
print(hours, minutes)
a = int(input())
b = int(input())
n = int(input())
cost = n * (100 * a + b)
print(cost // 100, cost % 100)
2.16 – Century
year = int(input())
print((year - 1) // 100 + 1)
2.17 – Snail
h = int(input())
a = int(input())
b = int(input())
print(ceil((h - a) / (a - b)) + 1)
h = int(input())
m = int(input())
s = int(input())
print(h * 30 + m * 30 / 60 + s * 30 / 3600)
https://snakifyanswers.wordpress.com 5/9
25-02-2024 12:35 Snakify Answers
alpha = float(input())
print(alpha % 30 * 12)
Section 3
3.1 – Is positive
a = int(input())
if a > 0:
print('YES')
else:
print('NO')
3.2 – Is odd
a = int(input())
if a % 2 == 1:
print('YES')
else:
print('NO')
3.3 – Is even
a = int(input())
if a % 2 == 0:
print('YES')
else:
print('NO')
if int(input()) % 10 == 7:
print('YES')
else:
print('NO')
https://snakifyanswers.wordpress.com 6/9
25-02-2024 12:35 Snakify Answers
a = int(input())
b = int(input())
if a < b:
print(a)
else:
print(b)
a = int(input())
b = int(input())
if a % 2 == 1 and b % 2 == 1:
print('YES')
else:
print('NO')
a = int(input())
b = int(input())
if a % 2 == 1 or b % 2 == 1:
print('YES')
else:
print('NO')
a = int(input())
b = int(input())
if a % 2 == 1 and b % 2 == 0 or a % 2 == 0 and b % 2 == 1:
print('YES')
else:
print('NO')
x = int(input())
if x > 0:
print(1)
elif x == 0:
print(0)
else:
print(-1)
https://snakifyanswers.wordpress.com 7/9
25-02-2024 12:35 Snakify Answers
a = int(input())
b = int(input())
c = int(input())
if a < b and b < c:
print('YES')
else:
print('NO')
a = int(input())
if a >= 100 and a < 1000:
print('YES')
else:
print('NO')
a = int(input())
b = int(input())
c = int(input())
if b >= a <= c:
print(a)
elif a >= b <= c:
print(b)
else:
print(c)
a = int(input())
b = int(input())
c = int(input())
if a == b == c:
print(3)
elif a == b or b == c or a == c:
print(2)
else:
print(0)
https://snakifyanswers.wordpress.com 8/9
25-02-2024 12:35 Snakify Answers
x1 = int(input())
y1 = int(input())
x2 = int(input())
y2 = int(input())
if x1 == x2 or y1 == y2:
print('YES')
else:
print('NO')
column = int(input())
row = int(input())
if row % 2 == column % 2:
print('BLACK')
else:
print('WHITE')
x1 = int(input())
y1 = int(input())
x2 = int(input())
y2 = int(input())
if (x1 + y1 + x2 + y2) % 2 == 0:
print('YES')
else:
print('NO')
https://snakifyanswers.wordpress.com 9/9