0% found this document useful (0 votes)
3 views2 pages

Python Basics: Variables, Data Types, Operators

The document provides an introduction to Python, highlighting its simplicity, open-source nature, and high-level capabilities. It covers basic programming concepts such as variables, data types, keywords, comments, and operators, along with examples. Additionally, it includes a sample program to demonstrate printing output in Python.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Python Basics: Variables, Data Types, Operators

The document provides an introduction to Python, highlighting its simplicity, open-source nature, and high-level capabilities. It covers basic programming concepts such as variables, data types, keywords, comments, and operators, along with examples. Additionally, it includes a sample program to demonstrate printing output in Python.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1) Introduction to Python:

1. Python is simple &easy language


2. Free and open source
3. High level
4. Developed by Guido Van Rossum
2) First program:
Print (“Hello, Devyani Here”)
This is the basic program to print the output to the terminal
3) Python Character Set:
1. Letter - A to Z, a to z
2. Digits - 0 to 9
3. Special symbols - + - * / etc.
4. Whitespaces, blank space, tab, carriage return, newline, form feed
5. Other Characters
4) Variables:
Variable is a name given to a memory location in a program
Ex. Name = “Devyani”
Age = 25
Price = 99.99
5) Data Types:
1. Int: Represents whole numbers without decimal points, with virtually
unlimited length.
2. Float: Represents numbers with decimal points.
3. String: This stores sequences of characters.
4. Boolean: Represents one of two values: True or False, used in logical
operations.
5. None: Represents the absence of a value or a null value. There is a
single value of this type, None.
6) Keyword:
Keywords are reserved words in python, which we cannot use it as a
variable.
For Ex. If, else, and, or, in is, True, False, assert, lambda, try, except,
finally, with, while, for, not, global, pass, import, elif, from, rais, etc.
7) Comments:
Comments are not executable lines in the code, usually comments are
used to make code more readable.
There are two types of comments are there
1. Single Line Comments:
2. Multi Line Comments:
8) Operators:
An operator is a symbol that performs a certain operation between
operands
Types of Operators:
1. Arithmetic Operator: +, -, /, *, **, %
2. Relational/Comparison Operator: ==, !=, >, <, >=, <=,
3. Assignment Operators: =, +=, -=, *=, /=, %=, **=
4. Logical Operators: Not, AND, OR

You might also like