4:
with open('Input.txt') as file:
n = file.readline().strip()
with open('Output.txt', 'w') as file:
if n == n[::-1]:
file.write('1')
else:
file.write('0')
5:
k = input('k = ')
if k.count(k[0]) == 2 or k.count(k[1]) == 2:
print(1)
print(0)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
4:
with open('Input.txt') as file:
n = file.readline().strip()
with open('Output.txt', 'w') as file:
if n == n[::-1]:
file.write('1')
else:
file.write('0')
5:
k = input('k = ')
if k.count(k[0]) == 2 or k.count(k[1]) == 2:
print(1)
else:
print(0)