Q. Write a program as per following specification :
"Return the length of the shortest string in the tuple of a strings str_tuple.
Precondition : the tuple will contain at least one element."
You can understand by Watching video :-
Answer :-
tup = eval(input("Enter the string tuple = ")) short = tup [ 0 ] for i in tup : if len(i) < len( short ) : short = i print("Smallest string in tuple = ",short)
Output :-
Enter the string tuple = ("path","walla","portal","express","computer","python")
Smallest string in tuple = path
>>>
Enter the string tuple = ("Python","C+++","Java","CSS")
Smallest string in tuple = CSS
>>>
4th line cant understand
ReplyDeletePlease watch the video https://www.youtube.com/embed/ih1McyrFEpA
Deletei means what
ReplyDeletePlease watch the video for clear explanation.
DeleteWrong Program infact not just this but most of them are for here I will proof so here we need to find length but there is no mention about length in the program so basically wrong because it won't give the desired output
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )