0% found this document useful (0 votes)
2 views1 page

variables_python

python data types in txt format

Uploaded by

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

variables_python

python data types in txt format

Uploaded by

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

WHAT IS A VARIABLE?

Variables is a like a container that holds the data. creating a variable is like
creating a placeholder in memory and assigning it some values.

WHAT ARE DATA TYPES?


Data type specifies the type of value a variable holds. this is required in
programming to do various operations without causing an error. we can print the
type of variable using (type) function.

PYTHON DATA TYPES

1.NUMERIC DATA TYPES


a) int-- contains complete numbers[both negative and positive](1,2,3,4)

b) float-- contains decimal values (9.90, 9.3059, -9.8907)

c) complex-- contains complex values (3+4i)

2.TEXT DATA TYPE


a) string-- contains letters and sentences ("hello", "h", )
{NOTE::-- double and single and double quotes are required to create a string }

3. BOOLEAN DATA
contains values like True and False

4. SEQUENCED DATA

a) list-- lists are an ordered collection of data with elements seperated by a


comma and enclosed by square brackets. lists are mutable and can be modified after
creation.
[1,2,3,4,6], ["apple","banana", "orange"]

b) tuples-- tuples are an ordered collection of data with elements seperated by a


comma and enclosed by parenthisis{()}. tuples are immmutable and caannot be
modified after creation.

(1,2,3,4,),("apple","banana","orange")

5. MAPPED DATA
a) dict-- a dictionary is an unordered collection of data containing a key:value
pair. and enclosed by curly brackets.

{"name":"Jack","title":"duniya ka papa","aura":10000000}

You might also like