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

Python19th June2024 06

Uploaded by

Cloud training
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)
3 views3 pages

Python19th June2024 06

Uploaded by

Cloud training
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/ 3

Python Class

19th June 2024

str represent string data type

A string is a sequence of characters enclosed within single quotes or double quotes.

e.g. s1 = 'Rohit'
s2="Rohit"
str Data Type Note: By using single quotes or double quotes we cannot represent multi line string
literals.

We can also use triple quotes to use single quote or double quote in our String.
''' This is "character'''

We can embed one string in another string.


Python Class
19th June 2024

In python the following data types are considered as Fundamental Data Type

int
float
complex
bool
str

In python, we can represent char values also by using str type and explicitly char type is not available.
About Python Data
Type

Long Data type is available in python2 but not available in python3. In Python3 long values also we can
represent by using int type only.
TYPE CASTING IN PYTHON

We can convert one type of value to another type. This conversion is called Typecasting or
Type conversion.

The following are various inbuilt function for type casting in python:
Type casting int()
float()
complex()
bool()
str()

We can convert from any type to int except complex type.


if we want to convert str type to int type, compulsory str should contain integral
values and should be specified in base-10.

You might also like