Page 1 :
Unit I: Computational Thinking and Programming - 1, , , , Chapter- 8 Python Programming Fundamentals, , "The only way to learn a new programming language is, , by writing programs in it." - Dennis Ritchie, , Sa Co BK (ey, , , , , , , , 1 Python Character Set, 2 Tokens, , > Keywords, , > Identifiers / Variable, > Literals / Values, , > Delimiters, , > Operators, , > Variable, , , , , , , , , , , , 3 Concepts of L-Value and R-Value, , 4 Comments, , 5 Statement, , 6 Clarity and simplicity of expression, 7 Blocks and Indentation, , , , , , , , , , Page lof 14
Page 2 :
Unit I: Computational Thinking and Programming - 1, , Chapter- 8 Python Programming Fundamentals, , A character can represents any letter, digit, or any other sign. Following, , , , are some of the python character set., , , , LETTERS AtoZandatoz, , , , DIGITS 0-9, , , , xe) (ENA) ekg Space, +-* *\[] {}=!=<>.__;:&#, under score(_) etc., , , , Blank space, horizontal tab ( - >), carriage return , Newline,, , , , WHITE SPACE, , Form feed., OTHER Python can process all ASCII and Unicode characters as part, CHARACTERS of data or literals., , , , , , , , , , The smallest individual unit in a program is known as token or lexical unit., , | TOKENS, , Literals Delimiters Operators, , , , , , , , Identifier, or, Varuables, , Keywords are special identifiers with predefined meanings that cannot, , Keywords, , change. As these words have specific meaning for interpreter, they, , cannot be used for any other purpose., , Page 2 of 14
Page 3 :
Unit I: Computational Thinking and Programming - 1, , Chapter- 8 Python Programming Fundamentals, , , , , , , , , , , , and exec not | continue if return | except| else, , as finally or def import | try class | lambda, assert for Pass del in while | global | yield, break | from | print elif is with raise class, , , , , , , , , , , , , , , , , , , , Identifiers are names given to identify something. Identifiers are, fundamental building blocks of a program and are used as general, terminology for the names given to different part of the program that is, , variables, objects, classes, functions, lists, dictionaries etc., , , , NOTE: An identifier must not be a keyword of Python, , There are some rules you have to follow for naming identifiers:, , > An identifier starts with a letter A to Z or a to z or an underscore (_), followed by zero or more letters, underscores and digits (0 to 9)., , > Python does not allow special characters, , > Identifier must not be a keyword of Python., , > Python is a case sensitive programming language., , Thus, Sname and sname are two different identifiers in Python., , Page 3 of 14
Page 4 :
Unit I: Computational Thinking and Programming - 1, , Chapter- 8 Python Programming Fundamentals, , Some valid identifiers: Mybook, file123, z2td, date_2,__no, , Some invalid variable name which produces syntax errors are as follows, >>> 98Sep_sco — SyntaxError: invalid syntax because variable start with a digit, , >>> Your Age SyntaxError: invalid syntax because variable contains space, , >>> while SyntaxError: invalid syntax because variable is a reserve word, , >>> myname@ SyntaxError: invalid syntax because variable contains a special character, , Literals in Python can be defined as number, text, or other data that, represent values to be stored in variables. The data items which never, change their value throughout the program run. There are several kinds, , of literals:, , > String Literals, , > Numeric Literals, , > Boolean Literals, , > Special Literal None, , > Literal Collections, , Page 4 of 14
Page 5 :
Unit I: Computational Thinking and, , Programming - 1, , Chapter- 8 Python Programming Fundamentals, , , , , , , , , , , , , , , , , , , , oa LOR Boy Example, Numeric Literals : The numeric literals in Python can belong to any of the following, different numerical types:, int Used to integer value Age =20, float Used for real value Perc = 98.5, complex Used to part of complex number |x =1+0i, bool : It is logical literal | Used to logical /Boolean Result = True, Text Literals: is a sequence of letters surrounded by either by single or double or triple, quotes., String Literal Used to Unicode/Text/String Name = ‘Johni', fname="Johny", bytes ASCII test/string “learnpython4cbse.com", None Type : It is special] No - value None(and no other object), , , , , , , , Following are the python delimiters., , Paice Classification, , Used to implement the grammatical and structure of Syntax., Delimiters are used in various areas of the Python language. They are, , used to build expressions, string literals, tuples, dictionaries or lists., , , , , , , , ( ) [ ] { } Grouping, ‘i : 5 @ . . / # Punctuation, &= I= A= <<= >D= Bit-wise assignment, = + = Ma Ye //= %= *F= Arthmetic assignment, , , , , , , , , , two, or three operands, and then return a result., , Page 5 of 14, , Operators are special symbols that perform specific operations on one,