Python Practical No.1
Python Practical No.1
1
Q.Introduction to python and python datatypes.
1) Installation of python
2) Values and types:
5) String operations:
(concatenation ,repetition)
=>In Python, strings are used for representing textual data. A string is a sequence of
characters enclosed in either single quotes ('') or double quotes (“”).
=>String concatenation is a common operation in programming. It involves joining two or
more strings to create a single new string.
=>The simplest way to repeat a string in Python is with the * operator. Use the operator on a
string to repeat the string a provided number of times.
6) Comparison operators
( “==” , “!=” ,”<=” , “>=” )
=>Python provides several comparison operators:
==: Equal to
!=: Not equal to
>: Greater than
<: Less than
>=: Greater than or equal to
<=: Less than or equal to
7) Logical operators
( and , or , not )
=>Python has three logical operators:
and: Returns True if both operands are True.
or: Returns True if at least one operand is True.
not: Inverts the truth value of the operand.