These exercises do not need to be completed in order, but they are generally ordered in increasing difficulty. The solutions provided are not the only possible solution. Your's might look different, and that is okay!
-
Write a Python program to calculate the length of a string (from w3resource).
-
Write a Python script that takes input from the user and displays that input back in upper and lower cases (from w3resource).
-
Make a program that takes a string and outputs that string with the first letter of each word capitalized.
-
Given an input string, write a program that identifies the index of the first instance of a character within that string.
-
Given an input string, find the three most common characters within that string and the number of times they are contained.
-
Write a program to split a given string on hyphens and display each substring (from PYnative).
-
Write a program to create a new string made of an input string’s first, middle, and last character (from PYnative).
-
Write a Python program to change a given string to a new string where the first and last chars have been exchanged (from w3resource).
-
Write a Python program to get a single string from two given strings, separated by a space (from w3resource).
-
Write a Python program to add 'ing' at the end of a given string (length should be at least 3). If the given string already ends with 'ing' then add 'ly' instead. If the string length of the given string is less than 3, leave it unchanged (from w3resource).
-
Write a Python program to remove the nth index character from a nonempty string (from w3resource).
-
Write a Python program to get the last part of a string before a specified character (from w3resource).
-
Write a Python program to add a prefix text to all of the lines in a string (from w3resource).
-
Write a Python program to accept a filename from the user and print the extension of that (from w3resource).