Showing posts with label Python Programming. Show all posts
Showing posts with label Python Programming. Show all posts

Saturday, 22 May 2021

// // Leave a Comment

Do you know what is character set?

CHARACTER SET

A set of valid characters recognized by python. Python uses the traditional ASCII character set. The latest version recognizes the Unicode character set. The ASCII character set is a subset of the Unicode 
Character set 
Letters :–A-Z, a-z 
Digits :– 0-9 
Special symbols :– special symbol available over keyboard 
White spaces:– blank space, tab, carriage return, new line, form feed 
Other characters:- Unicode 

TOKEN
Smallest individual unit in a program is known as token. 
1. Keywords 
2. Identifiers 
3. Literals 
4. Operators 
5. Punctuators  
Keywords 
Keywords are reserved words that convey a special meaning to the language compiler. Reserve word of the compiler/interpreter which can’t be used as identifier.
Identifiers
An identifier is a  sequence of letters and numbers. Identifier is name used to identify a variable, function, class, module or other object. It is created by programmer using characters.
  1. 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). 
  2. Programming languages does not allow special characters. 
  3. Identifier must not be a keyword 
  4. It is a case sensitive programming language. Because, it treats upper and lower case characters differently
Literals
Literals can be defined as number, text, or other data that represent values to be stored in variables. They are data items that never change their values during a program run.
Operators
Operators can be defined as symbols that are used to perform operations on operands
Types of operators 
1. Arithmetic Operators. 
2. Relational Operators. 
3. Assignment Operators. 
4. Logical Operators. 
5. Bitwise Operators 
6. Membership Operators 
7. Identity Operators
Punctuators / Separators
It is used to implement the grammatical and structure of a syntax and enhances program's readability and give proper meaning to statements, expressions, etc. These are the punctuators. [ ] ( ) { } , ; : * = #  
Read More
// // Leave a Comment

Introduction to Python

INTRODUCTION 
Python is widely used general purpose, high level programming language. Developed by Guido van Rossum in 1991. It is used for software development, web development (server-side), system scripting, mathematics. 

Features of Python 
1. Easy to use – Due to simple syntax rule 
2. Interpreted language – Code execution & interpretation line by line 
3. Cross-platform language – It can run on windows, linux,   etc.                equally 
4. Expressive language – Less code to be written as it itself express the purpose        of the code. 
5. Completeness – Support wide rage of library 
6. Free & Open Source – Can be downloaded freely and source code can be modify for improvement Shortcomings of Python 
1. Lesser libraries – as compared to other programming languages like C++, Java, .Net 
2. Slow language – as it is interpreted languages, it executes the program slowly. 
3. Weak on Type-binding – It not pin point on use of a single variable for different data type.
 
Input and Output   
variable1=‘Python Programming' 
variable2=‘Java Programming ' 
print(variable1,' and ',variable2,' ) 
Output :Python Programming and Java Programming 
raw_input() function in Python allows a user to give input to a program from a keyboard but in the form of string. 
 
Read More