Boys A Liar - Py
Boys A Liar - Py
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 ")
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 ")
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