0% found this document useful (0 votes)
27 views4 pages

Boys A Liar - Py

python

Uploaded by

naitiktiwari09
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)
27 views4 pages

Boys A Liar - Py

python

Uploaded by

naitiktiwari09
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/ 4

while True:

print('***Main Menu***')
print("Choose Your Data Type")
print("1.) List ")
print("2.) String")
print("3.) Dictionary ")
ch=int(input("Enter the no. beside your choice (1,2,3): "))
if ch==1:
print("*************************")
l=[]
n=int(input("how many elements you want in the list: "))
print("Enter your list elements : ")
for i in range (0,n):
x=input()
l.append(x)
print("Your List = ",l)
print("***Main Menu***")
print("Choose Your Modifications ;) : ")
print("1.) operators ")
print("2.) function")
print("3.) Wanna Remove elements ;) :")
print("4.) Membership ")
print("5.) Wanna put it on Display ")

ch1=int(input("Enter the no. beside your choice (1,2,3,4,5): "))


if ch1==1:
ch11=str(input("Enter the operant (+,*) : "))
if ch11=="+":
n=int(input("how many elements you want in the list to be added :
"))
print("Enter the elments row wise")
ligma=[]
for j in range (0,n):
niggers=input()
ligma.append(niggers)
print("New list : ",l+ligma)
if ch11=="*":
n=int(input("how many times you want to multiply list : "))
print("New list : ",l*n)

elif ch1==2:
print("Choose Your Modifications ;) : ")
print("1.) Extend ")
print("2.) Append")
print("3.) Insert :")
print("4.) Lenth of the list ")
print("5.) Index ")
print("6.) count :")
print("7.) reverse ")
print("8.) sort ")
ch12=int(input("Enter the no. beside your choice (1,2,3,4,5,6,7,8):
"))
if ch12==1:
no=int(input("how many elements you want in the list to be extended
: "))
print("Enter the elments row wise")
ligmamales=[]
for crazydiamond in range (0,no):
nigger=input()
ligmamales.append(nigger)
l.extend(ligmamales)
print("List created ",ligmamales)
print(l)
if ch12==2:
no=int(input("how many elements you want in the list to be append :
"))
print("Enter the elments row wise")
for crazydiamond in range (0,no):
nigger=input()
l.append(nigger)
print(l)
elif ch12==3:
index=int(input("Enter the position of the element for insertion ;)
(start from 0)"))
entah=input("Enter the element to enter ")
l.insert(index,entah)
print(l)
elif ch12==4:
print(len(l))
elif ch12==5:
search=str(input("Enter the element to be searched for index "))
if search in l :
print(l.index(search))
else:
print("Not found")
elif ch12==6:
cunt=str(input("Enter the element to be searched for counting "))
print(l.count(cunt))
elif ch12==7:
l.reverse()
print("new list is ",l)
elif ch12==8:
l.sort()
print("new list is ",l)
elif ch1==3:
print("Choose Your Modifications ;) : ")
print("1.) del ")
print("2.) skrr pop pop pop")
print("3.) slice n dice :")
print("4.) clear ")
ch13=int(input("Enter your choice (1,2,3,4):"))
if ch13==1:
dekete=str(input("Enter what you want to delete:"))
l.remove(dekete)
print("New list is now ", l)
elif ch13==2:
ind=int(input("Enter the index to pop :"))
l.pop(ind)
print(l)
elif ch13==3:
skibidi=int(input("Enter the index to start slicing from :"))
toilet=int(input("Enter the index to end slicing from (Must be
greater than skibidi):"))
l=l[skibidi:toilet]
print(l)
elif ch13==4:
l.clear()
print("List cleared",l)
elif ch1==4:
member=str(input("Enter the membership operator you want to work with
in or not in (choose from 1 or 2 )"))
if member=="in" or member=="1":
check=str(input("Enter the element you want to check :"))
if check in l :
print("The element is inside the list ")
else:
print("The element is not inside the list")
else:
check=str(input("Enter the element you want to check :"))
if check not in l:
print("The element is not inside the list ")
else:
print("The element is not inside the list")
elif ch1==5:
print(l)
if ch==2:
print("*************************")
s=str(input("Enter you string : "))
print("Your string = ",s)
print("***Main Menu***")
print("Choose Your Modifications ;) : ")
print("1.) Capitalise all words")
print("2.) Search a word")
print("3.) check the digits in the string;) :")
print("4.) Convert Upper to lower ")
print("5.) Replace the the occurance of a substring")
print("6.) Count the total words in range ")

ch2=int(input("Enter the no. beside your choice (1,2,3,4,5): "))


if ch2==1:
nigga=s.title()
print(nigga)
elif ch2==2:
sea=str(input("Enter this thingy mabob to search like wassup"))
if sea in s:
k=s.find(sea)
print("the search element is after ",k,"th index")
else:
print("Not found")
elif ch2==3:
for starplatinum in range (0,len(s)):
i=0
if s[starplatinum] in "0123456789":
i+=s[starplatinum]
print(s[starplatinum])
if i==0:
print("No numbah in here")
elif ch2==4:
ns=""
for stonefree in range (0,len(s)):
if s[stonefree].isupper()==True:
ns+=s[stonefree].lower()
if s[stonefree].islower()==True:
ns+=s[stonefree].upper()
s=ns
print(s)
elif ch2==5:
re=str(input("What do you want to replace :"))
er=str(input("With What : "))
s=s.replace(re,er)
print(s)
elif ch2==6:
print(len(s.split()))

if ch==3:
print("*************************")
numba=int(input("How man pairs you want to have in the dictionary :"))
d={}
for kingcrimson in range (0,numba):
a=input("Enter Key :")
b=input("Enter value :")
d[a]=b
print(d)
print("***Main Menu***")
print("Choose Your Modifications ;) : ")
print("1.) Delete key")
print("2.) display only keys")
print("3.) display only values:")
print("4.) Modify the value of keys as per user : ")
ch3=int(input("Enter your choice (1,2,3,4) :"))
if ch3==1:
dele=input("Enter key to be deleted :")
del d[dele]
print(d)
elif ch3==2:
print(list(d.keys()))
elif ch3==3:
print(list(d.values()))
elif ch3==4:
replacment=input("Enter key :")
rep=input("Enter the new value :")
d[replacment]=rep
print(d)
coc = (input('Do you want to continue: '))
if coc == 'no':
break

You might also like