Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # version 2 of https://pastebin.com/C4hu4ys1
- bc = input("Geben Sie einen Barcode ein: ") #bc = Barcode
- def main():
- a =stringcheck()
- b = weightcheck()
- c = a+b
- print(switch(c))
- def stringcheck():
- if bc.isdecimal(): #tests if "bc" only has digits
- return "2"
- else:
- return "1"
- def weightcheck():
- if int(bc[8:13]) > int(bc[18:23]):
- return "2"
- else:
- return "1"
- def switch(z):
- switcher = {
- 22 : "Fehlercode 0",
- 12 : "Fehlercode 1",
- 21 : "Fehlercode 2",
- 11 : "Fehlercode 1 und 2"
- }
- return switcher.get(z)
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement