Python was created by Guido van Rossum and is an interpreted, interactive object-oriented programming language. Python identifiers follow specific naming conventions, starting with a lowercase letter for most names and uppercase for class names. Identifiers can include letters, numbers, and underscores but cannot start with a number or be a keyword. Python has primitive, referential, and objective built-in data types including integers, floats, strings, lists, tuples, and dictionaries. It supports common operators like arithmetic, comparison, assignment, logical, bitwise, membership, and identity operators. Python code uses sequences, selections, and iterations.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
29 views
Python 2
Python was created by Guido van Rossum and is an interpreted, interactive object-oriented programming language. Python identifiers follow specific naming conventions, starting with a lowercase letter for most names and uppercase for class names. Identifiers can include letters, numbers, and underscores but cannot start with a number or be a keyword. Python has primitive, referential, and objective built-in data types including integers, floats, strings, lists, tuples, and dictionaries. It supports common operators like arithmetic, comparison, assignment, logical, bitwise, membership, and identity operators. Python code uses sequences, selections, and iterations.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13
Computer Science for AS/A2
Python was developed by Guido van Rossum
Python is Interpreted Python is Interactive Python is Object-Oriented Open a Web browser and go to https://www.python.org Follow the link for the Windows installer python-XYZ.msi file where XYZ is the version you need to install. Run the downloaded file Go to the command prompt : Type “cmd” in the run dialog box. type set path %path%;C:\Python A Python identifier is a name used to identify a variable, function, class, module or other object. 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). Names are case sensitive and cannot start with a number. They can contain letters, numbers, and underscores. bob Bob _bob _2_bob_ bob_2 BoB Keyword cannot be identifier name. Class names start with an uppercase letter. All other identifiers start with a lowercase letter. Starting an identifier with a single leading underscore indicates that the identifier is private. ( e.g : _google) Starting an identifier with two leading underscores indicates a strongly private identifier. ( e.g : __google) If the identifier also ends with two trailing underscores, the identifier is a language- defined special name. (e.g : __init__ ) Built in data types
Primitive Referential Objective
•INT •LIST STRING
•FLOAT/REAL •TUPLE •LONG •DICTIONARY •COMPLEX •BOOLEAN o Arithmetic Operators
o Comparison (Relational) Operators
o Assignment Operators
o Logical Operators
o Bitwise Operators
o Membership Operators
o Identity Operators X << Y o X >>Y o Sequence