>>> import decimal
# By default rounding setting in python is decimal.ROUND_HALF_EVEN
>>> decimal.getcontext().rounding = decimal.ROUND_DOWN
>>> c = decimal.Decimal(34.1499123)
# By default it should return 34.15 due to '99' after '34.14'
>>> round(c,2)
Decimal('34.14')
>>> float(round(c,2))
34.14
>>> print(round(c,2))
34.14
x = input("Please enter something:")
allowed = set('01')
def check(test_str):
return set(test_str) <= allowed
print(check('010111010110'))
print(check('1264893215'))
print(check('ZXvn,mdg^&%32012mjcv'))