Bob decided to go on a trip. There are total N kids on the trip. There are 3 types of toys - 'Type-I ', 'Type-2', and 'Type-3' available for distribution among N kids. Each of the kids is asked, what kind of toy he prefers from the current lot. If the kid does not like any toy from the current lot, then he or she would get a toy among the remaining types with equal probability.
For Full Instructions and Question Please Use Those Images as reference... Please help
https://drive.google.com/file/d/1b3RT2IBIBMG2Ojob6uGqoDglXHg-Z928/view?usp=sharing
dict1 = [1,-1,1,1,1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,1,-1,-1,-1,1,1,-1,1,-1]
dict2 = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
def string_process(string):
ind1 = dict2.index(string[len(string)-1])
if dict1[ind1-1] == 1:
string.replace(dict2[ind1-1],dict2[ind1])
else:
string.replace(dict2[ind1-1],dict2[ind1-2])
Comments
Leave a comment