Please help me on this. It is throwing error
inputBinary = bin(input)
length = len(inputBinary)
if(input >=8 and inputBinary[length-4]>0):
Hi my friend, you're almost there only change the "+" to "&" and you have the answer. Thanks, happy coding.
how can we use 'input' as an argument here? are we allowed to use predefined python variables as arguments??
It is not a good practice, from a readability standpoint, but the variable is locally defined so does not clash with the built-in function (afaik). Had it been defined globally, it would have replaced the function in the namespace requiring a restart of the shell to restore it.