Python Coding Questions asked in Companies
Remove duplicated from unsorted list [1,1,2,1,3,4,1,2,3,4]
[ Asked by Company - Accenture , Profile : Data Scientist Consultant ]
Solution : dup_list = [1,1,2,1,3,4,1,2,3,4]
unique_list = list()
for item in dup_list:
if item not in unique_list :
unique_list.append(item)
print(unique_list) = [1,2,3,4]
Count how many times each element occur in a list ?
[ Asked by Company - Accenture , Profile : Data Scientist Consultant ]
Solution : dup_list = [1,1,2,1,3,4,1,2,3,4] : Using Count:
Given a list A = [2,3,5,4,5,7,8,8,5,9] find most occurring number.
Write a code to check whether given string or number is Palindrome or not ?.
Second Approach: Without using any python inbuilt functionality