try:
print("This is a single-digit calculator.")
num1 = int (input ("Enter the first digit :")
num2 = int (input ("Enter the second digit :")
print("{0} / {1} = {2}".format(num1, num2, int(num1/num2)))
except ValueError:
print("Please enter a single digit number.")
except ZeroDivisionError as err:
print(err)
I'm a beginner at Python.
I'm practicing the code above
num1
The color does not equal num2
.
I touched the linting in setting, Should I touch the settings? Is the code grammar wrong?
python error
You have to check the number of brackets properly.
# Example
num1 = int (input ("Enter the first digit :")
=>
num1 = int (input ("Enter the first digit : ")))
© 2024 OneMinuteCode. All rights reserved.