In this chapter, I will create a method which will accept a list consists of sub-lists as the first input p
Below is the method which we will create.
def bingo(ticket,win): count = 0 #the total wins for lottery in ticket: for char in lottery: if(ord(char) == lottery): count += 1 break if(count>=win): return 'Winner!' else: return 'Loser!'
If we enter below parameters into that method…
print(bingo([['ABC', 65], ['HGR', 74], ['BYHT', 74]], 1))
Then we will win the lottery. Hope you like this short solution, I will start a new project on the next article so we will temporarily stop the one day one question series for a while and concentrate on our next python project.