0% found this document useful (0 votes)
7 views4 pages

Lecture Notes 2

Basics of Python

Uploaded by

yogesh200512
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Lecture Notes 2

Basics of Python

Uploaded by

yogesh200512
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

NOTES BY: - PRASAD ADSULE

LECTURE NO.2

Sr.
No Content Description Example
.
Comments are generally
used to explain the code.
Must use the comments
because in the future
anyone wants to modify the
Commenting code as well as implement
1)
the new module; then, it
can be done easily.
Write sentence after # to
make it comment.
# we are learning python

Deletion
2) To delete a variable, string
del ()

Means conversion of one data type to another data type

Type Casting a) converting int into float

conversion of
3)
one data type
to another
data type

b) converting float into int


c) converting int and float
to complex

d) conversion of int and


float and complex to string

e) Conversion of

i) complex to int or float is


not possible
3) Type Casting ii)string of char. to int or
float is not possible

f)
i) If the string contains
integer character then only
it can be converted to int or
float

ii)If the string contains float


character then it can be
only be converted to float
4) Input () Taking input from user

Specific amount of space


5) Indentation after any condition or
statements.

Math Operators

+ - Addition and subtraction

Multiplication and
* / Division
6)

// Floor division
To get value of division
Floor division
before decimal point
only

Modulo division
%
Modulo To get reminder of the
division division
To get round fig. value
up to required decimal
point

In the round (,)


round (,) Before comma put the
variable name and After
comma put the number
up to which the decimal
point round fig value is
required.

X**y
Power **
To measure Yth power
of X

Mixed Operation example

You might also like