Hello I have a program that must scan and save barcodes to a variable. Everything is working properly except for the fact that I am getting an error whenever a bar code starts with a 0.
Here is a sample of my code:
user_code = eval(input("Hello please enter a coupon code: "))
I must use eval(input(.... because I muse pass this integer to openpyxl(to store variables in an excel file)
But everytime a barcode starts with 0 I get this error:
Hello please enter a coupon code: 0555
Traceback (most recent call last):
File "C:/Users/HP/Documents/PycharmProjects/coupon_scanner/coupon_scanner_V5.py", line 149, in <module>
user_code = eval(input("Hello please enter a coupon code: "))
File "<string>", line 1
0555
^
SyntaxError: invalid token