Find Second Smallest Number in List Python | Python Interview Questions

preview_player
Показать описание
Code for Finding Second Smallest Number in Python at 02:13.
This is a very important Python Interview question.
This is an explanation of python interview questions and answers.

This is trainwithshubham by shubham londhe.
Рекомендации по теме
Комментарии
Автор

What if two elements of this list were 0, we need to change ssm only when num != sm and num <ssm.

djain
Автор

l=list(map(float, input('chal dal: ').split(', ')))
print(l)
p=min(l)
l.remove(p)
print(min(l))
l.append(p)
print(l)





This may also work🙏🙏

himanshsworld
Автор

just sort the list and print list[1]
it will work right?

chopz
Автор

this code won't work for the test case nums=[2, 2, 2, 2, 6]

pankajrao
Автор

sir ('inf') lene se kya hota hai? thora bata dijiye please

pritamparali