[Solved] Given a non-empty list of strings of the same length, how do I create a list of lists of the letters at each position in the string without using zip? [closed]

[ad_1] Given a non-empty list of strings of the same length, how do I create a list of lists of the letters at each position in the string without using zip? [closed] [ad_2] solved Given a non-empty list of strings of the same length, how do I create a list of lists of the letters … Read more

[Solved] calculate and return the difference between the second largest number and the second smallest number [closed]

[ad_1] Here is a simple, but not most efficient way. you can achieve that by two step: convert list to set, to remove the duplicate number. use heap to find nlargest and nsmallest in set def difference(list1): set1 = set(list1) return heapq.nlargest(2, set1)[1] – heapq.nsmallest(2, set1)[1] Here is a one pass way, more efficient way, … Read more

[Solved] I have given nested list accessing via for loop, but I can’t getting result?

[ad_1] patientsList = [[‘sagar’,’9856782311′],[‘mahsh’,’7865423158′]] search = input(“Enter mobile number of patient to search: “) for patient in patientsList: ”’ patient looks like this [‘sagar’,’9856782311′] patient[0] is the name patient[1] is the phone number ”’ if search == patient[1]: print(“Required patient is”) print(patient) print(“is Appointed”) break 9 [ad_2] solved I have given nested list accessing via … Read more