0% found this document useful (0 votes)
17 views5 pages

Python Basics: Lists, Tuples, and Sets

Uploaded by

Tanuj kumar
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)
17 views5 pages

Python Basics: Lists, Tuples, and Sets

Uploaded by

Tanuj kumar
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

print('hello')

print("hello")
print('''hello''')
print("""thanos""")

#list method append()


w=[1,2,3]
[Link](4)
#print(append(4))
print(w)

#list method pop()


w=[1,2,3]
[Link]()
print(w)

from re import X
d=10;print(d)
d1=20
d1
_s=40
_s
x3=50;print(x3)

a=10
a=234
a2=2 * (2/3)
a3=2 + 1j
print(a3-a2)

name='thanos'
print(f'Hello, {name}, welcome!')

name= 'thanos'
age= 18
country= 'India'
print(name, age, country)

import math as m
f=[Link](90)
e=m
f

a= bool('true')
type(a)

a = int(10)
a1 = float(6.9)
a2 = complex (2j)
print(a1 - a)
print(a2 - a * a1 * a2)
a= bytes(10)
a

a= int(10.6)
a1= float(10.6)
print(a1-a)

d1= {'a': [1,2,3]}


print(d1)

a=bytearray(10)
a

l=[1,2,3]
print(1)
type(l)

y=(2,4,5)
print(y)
type(y)

t={1,2,3,4,5,6,7,8}
type(t)

y={'d':'nigga'}
type(y)

#Arithmeticoprator
a=10
b=5
f=a+b
X=a*f-b
print(f)
print(X)

a=10
b=3
f=a>b
print(f)

a=10
b=3
a==b
b

d=90
d+=10
d

d=69
d/=10
d

e=10
h=124
l=e&h
print(l)

e=80
h=54
l=(e & h)and(e|h)
print(l)

e=54
h=35
l=e is not h
print(l)

#list method remove()


w=[1,2,3]
[Link](2)
print(w)

#list method insert()


w=[1,2,3]
[Link](2,9)
print(w)

#list method slice()


w=[1,2,3]
[Link](4)
print(w)

w=[1,2,3]
[Link]()
print(w)

w=[1,2,3]
#[Link]()
print(min(w))

l=[1,2,3]
#[Link]()
print(min(l))

l=[1,2,3]
#[Link]()
print(max(l))

w=[1,2,3,3,34,2,4,34,3,2,4,5,2,2,5,3,7,4,3,2,2,4,4,5,6,7,7,6,5,3,2,2,4,5,6,7,8
#[Link](2)
print([Link](2))

w=[1,2,3]
#[Link](1)
print([Link](1))

w=[2,6,5,67,6]
# p=([Link]())
# print(p)
print(sorted(w))

q=[1,2,3]
p=[4,5,6]
y=q+p
print(y)

l=[1,2,3]
t=(l*3)
u=2*4
g=[2,3]
#h=l*g
print(u)
print(t)
#print(h)

y='xhdyjttv'
print(y[0:7])

x = [1,2,3]
tuple_x = tuple(x)
print(tuple_x)
print(type(x))
print(type(tuple_x))

s={1,2,3}
[Link](5)
print(s)

s={1,2,3}
[Link](3)
print(s)

l=[1,2,3,4,5,6]
print(l)
print(l[2:4])
print(l[0])

s=[1,2,3,4,5]
print(s[-1])
print(s[-4:-1])
5
[2, 3, 4]

s1=[1,2,3,4,5,6]
print(s[::])
print(s[1:5:2])
print(s[3::-2])

[1, 2, 3, 4, 5]
[2, 4]
[4, 2]

You might also like