VELAMMAL BODHI CAMPUS- ATTUR
CODING CLUB ACTIVITY FOR HIGH COMPARTMENT
WEEK-2(KEYWORD AND IDENTIFIERS USED IN PYTHON AND THEIR USAGES)
PYTHON CODING – JUNE MONTH
WEEK-1 (INTRODUCTION TO PYTHON FROM ORGIN TO TILL TODAY) Python Keywords
Python is a widely used general-purpose, high-level programming language. Keywords are predefined, reserved words used in Python programming that have special meanings
to the compiler.
It was initially designed by Guido van Rossum in 1991 and developed by Python
Software Foundation. We cannot use a keyword as a variable name, function name, or any other identifier. They are used
It was mainly developed for emphasis on code readability, and its syntax allows to define the syntax and structure of the Python language.
programmers to express concepts in fewer lines of code.
As of April 2023, the latest stable release is Python 3.11.3, with Python 3.12 on the
horizon.
The language continues to evolve, with new features and improvements being added
regularly.
Python's popularity has grown exponentially, and it has become a staple in various
industries, including web development, data analysis, machine learning, and more.
Python 1.0 (1994): Rules for Naming an Identifier
The first official release of Python, featuring exception handling, functions, and
Identifiers cannot be a keyword.
modules.
Identifiers are case-sensitive.
Python 2.0 (2000):
o Introduced list comprehensions, garbage collection, and Unicode support. It can have a sequence of letters and digits. However, it must begin with a letter or _. The first letter
of an identifier cannot be a digit.
o Python 2.0 laid the foundation for many features used in modern Python It's a convention to start an identifier with a letter rather _.
development.
Whitespaces are not allowed.
Python 3.0 (2008): We cannot use special symbols like !, @, #, $, and so on.
o A major update that aimed to fix inconsistencies and design flaws in Python 2.
Valid Identifiers Invalid Identifiers
o Some of the key changes include the print function, improved Unicode support, score @core
and changes in syntax and standard library organization.
return_value return
o Python 3.x is not backward compatible with Python 2.x, but many tools and
libraries have been developed to facilitate the transition. highest_score highest score
name1 1name
WEEK-4(SYNTAX ; BASIC PROGRAMS USING PYTHON SOFTWARE -HELLO WORLD)
WEEK-3(VARIABLES AND DATA TYPES)
The rules that define the structure of the language for python is called its syntax. Without this,
Python Data Types the meaning of the code is hard to understand.
In computer programming, data types specify the type of data that can be stored inside a variable.
These include the usage of symbols, punctuations, words and how you should use them while
you code in the language.
Data Types Classes Description
EXAMPLE:
Numeric int, float, complex holds numeric values
1. Print (HELLOWORLD )
2. Print your name , class and section using software
String str holds sequence of characters 3. Print your family members name using software.
Sequence list, tuple, range holds collection of items
Mapping dict holds data in key-value pair form
Boolean bool holds either True or False
Set set, frozenset hold collection of unique items
Python Variable
Python Variable is containers that store values.
A variable is created the moment we first assign a value to it. A Python variable is a name given to
a memory location. It is the basic unit of storage in a program.
Rules for Python variables
A Python variable name must start with a letter or the underscore character.
A Python variable name cannot start with a number.
A Python variable name can only contain alpha-numeric characters and underscores (A-z, 0-9,
and _ ).
Variable in Python names are case-sensitive (name, Name, and NAME are three different
variables).
The reserved words(keywords) in Python cannot be used to name the variable in Python.
EXAMPLE
>>> a= “WELCOME “
Print (a)
Output
WELCOME