# sample-python2.py: Python 2 code. It does NOT run under Python 3. # Free sample from 99helpers.com/file-types/py # Deliberately included for testing: Python 3 stops at line 9 with # SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? # Use it to check how an editor, linter or upload pipeline reports syntax # errors, or to recognise Python 2 code. Python 2 reached end of life in 2020. name = raw_input("Your name: ") print "Hello, %s" % name try: count = int(name) except ValueError, error: print "Not a number:", error print 7 / 2 # 3 in Python 2 (integer division); 3.5 in Python 3