The Python Language Reference, Release 3.9.5 Chapter 2. Lexical analysis 6 2.1.4 Encoding declarations 2.1.5 Explicit line joining 2.1.6 Implicit line joining If a comment in the first or second line of the Python script matches the regular expression$_{coding[=:]\s*([-\}$ w.]+) , this comment is processed as an encoding declaration; the first group of this expression names the encoding of the source code file. The encoding declaration must appear on a line of its own. If it is the second line, the first line must also be a comment-only line. The recommended forms of an encoding expression are which is recognized also by GNU Emacs, and which is recognized by Bram Moolenaar’s VIM. If no encoding declaration is found, the default encoding is UTF-8. In addition, if the first bytes of the file are the UTF-8 byte-order mark ( b'\xef\xbb\xbf' ), the declared file encoding is UTF-8 (this is supported, among others, by Microsoft’s$_{notepad}$). If an encoding is declared, the encoding name must be recognized by Python. The encoding is used for all lexical analysis, including string literals, comments and identifiers. Two or more physical lines may be joined into logical lines using backslash characters ($_{\}$), as follows: when a physical line ends in a backslash that is not part of a string literal or comment, it is joined with the following forming a single logical line, deleting the backslash and the following end-of-line character. For example: A line ending in a backslash cannot carry a comment. A backslash does not continue a comment. A backslash does not continue a token except for string literals (i.e., tokens other than string literals cannot be split across physical lines using a backslash). A backslash is illegal elsewhere on a line outside a string literal. Implicitly continued lines can carry comments. The indentation of the continuation lines is not important. Blank continuation lines are allowed. There is no NEWLINE token between implicit continuation lines. Implicitly continued lines can also occur within triple-quoted strings (see below); in that case they cannot carry comments. Expressions in parentheses, square brackets or curly braces can be split over more than one physical line without using backslashes. For example: # -*- coding: <encoding-name> -*- # vim:fileencoding=<encoding-name> if 1900 <year <2100 and 1<=month <=12\ and 1<=day <=31 and 0<=hour <24\ and 0<=minute <60 and 0<=second <60 : # Looks like a valid date return 1 month_names=['Januari','Februari ','Maart', # These are the 'April', 'Mei ', 'Juni', # Dutch names 'Juli', 'Augustus','September', # for the months 'Oktober','November','December'] # of the year