Longest and shortest word
Write a Python program to find the longest and the shortest word in a string. Step-by-step explanation, colour-coded code and real output.
Online Learning Platform
Free tutorials, solved practice problems and interview prep for QA and automation engineers: Python, Playwright, Selenium, SQL, Git and more.
Write a Python program to find the longest and the shortest word in a string. Step-by-step explanation, colour-coded code and real output.
Write a Python program to test whether a letter is a vowel or a consonant. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count how many times a substring occurs in a string. Step-by-step explanation, colour-coded code and real output.
Write a Python program to reverse a string if its length is a multiple of 4; otherwise return it...
Write a Python program to make a string of 4 copies of the last two characters of a string (length must be at least...
Write a Python program that returns the length of the longest string in a list. Step-by-step explanation, colour-coded code and real output.
Write a Python program to build a string from the first 2 and the last 2 characters of a string. If the string is shorter than 2 characters,…
Write a Python program to round every number in a list and print the sum of the rounded numbers multiplied by the list...
Write a Python program to decode a run-length encoded list, where [n, x] means x repeated n times. Step-by-step explanation, colour-coded code and real output.
Write a Python program to remove repeated dictionaries from a list. Step-by-step explanation, colour-coded code and real output.
Write a Python program to build a dictionary of each word and its length. Step-by-step explanation, colour-coded code and real output.
Write a Python program to remove the 2nd character of each word. Step-by-step explanation, colour-coded code and real output.
Take free timed mock tests with answers and explanations.