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

Python Basics: Lists and Data Types

The document demonstrates basic Python operations on variables, lists, tuples, sets, and dictionaries. It defines variables of different types, performs concatenation and type checking. It also shows list operations like appending, inserting, removing and popping elements. It defines a tuple and accesses elements. It creates a set and prints it. Finally, it defines a dictionary, accesses elements, takes user input and checks the type.

Uploaded by

prodecoy 9
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)
4 views1 page

Python Basics: Lists and Data Types

The document demonstrates basic Python operations on variables, lists, tuples, sets, and dictionaries. It defines variables of different types, performs concatenation and type checking. It also shows list operations like appending, inserting, removing and popping elements. It defines a tuple and accesses elements. It creates a set and prints it. Finally, it defines a dictionary, accesses elements, takes user input and checks the type.

Uploaded by

prodecoy 9
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

10/8/23, 9:01 PM ASE Python LAB.

ipynb - Colaboratory

ASE Python LAB

a = "samhitha"
b = 21
print(type(b))
c = "varnika"
print (a+c)

<class 'int'>
samhithavarnika

list = ["may", "kan", "keer", "dhan", "sam"]


print (list[0])
print (list[1])
print (list[2])
print (list[3])
print (list[4])

may
kan
keer
dhan
sam

list = ["may", "kan", "keer", "dhan", "sam"]


[Link]("A")
print(list)
[Link](3,"R")
print(list)
[Link]("kan")
print(list)
[Link](4)

['may', 'kan', 'keer', 'dhan', 'sam', 'A']


['may', 'kan', 'keer', 'R', 'dhan', 'sam', 'A']
['may', 'keer', 'R', 'dhan', 'sam', 'A']
'sam'

Tuple

tuple = ("may", "kan", "keer", "dhan", "sam")


print(tuple)
print(tuple[0])

('may', 'kan', 'keer', 'dhan', 'sam')


may

Set

set = {"may", "kan", "keer", "dhan", "sam"}


print (set)

{'kan', 'may', 'sam', 'keer', 'dhan'}

Dictionary

dic ={'a':"mat",'b':"kat",'c':"keer",'d':"dhan",'e':"sam"}
print (dic['a'])
a = int(input("Enter your age : "))
print (a)
print (type(a))

mat
Enter your age : 46
46
<class 'int'>

[Link] 1/2

You might also like