๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_strings_exercises.asp
Python - String Exercises
Python Variables Variable Names Assign Multiple Values Output Variables Global Variables Variable Exercises Code Challenge Python Data Types ... Python Strings Slicing Strings Modify Strings Concatenate Strings Format Strings Escape Characters String Methods String Exercises Code Challenge Python Booleans
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python exercises โ€บ python string exercises: 35+ coding problems with solutions
35+ Python String Coding Exercises with Solutions โ€“ PYnative
June 13, 2026 - Practice Python string exercises with solutions to improve your skills in string manipulation, slicing, and built-in functions. Includes 38 coding problems for beginners and intermediate learners.
Discussions

LearnPython.Org Trouble: Basic String Operator Exercise Solution.
I do not see how the prompts deliver the desired solution. They don't. They verify the desired solution - the string "Strings are awesome!" is the string that has the correct properties when those various methods are applied to it. More on reddit.com
๐ŸŒ r/learnpython
14
7
September 16, 2020
python exercises
Thoughts: Codewars Advent of Code r/dailyprogrammer (not updated "daily" anymore, but go through the history) More on reddit.com
๐ŸŒ r/learnpython
47
134
September 27, 2022
Good Python Exercises?
๐ŸŒ r/learnpython
58
411
December 3, 2022
i don't get this string exercise
Let me walk you through the code: name = 'World' Somewhere in memory, Python creates a new string object with the characters W, o, r, l, d. A variable is created with the name name and is assigned to reference the new string object. line = '-' Somewhere in memory, Python creates a new string object with the character -. A variable is created with the name line and is assigned to reference the new string object. for char in name: A loop is created which iterates over the string object referenced by name. On each iteration, a new string object is created to hold the single character from the current iteration, and char is assigned the memory location of that single character object. line = line + char The expression on the right is evaluated first. The two string objects referenced by the two variables are retrieved and concatenated (which is what the __add__ method for the str class does for the + operator). This creates a new string object somewhere in memory. The variable line is re-assigned to reference the new string object. The string object it referenced before this now has nothing referencing it and so Python can reclaim the memory occupied by that older object (deleting the object). Strings are immutable, so a string object cannot be changed. You have to create new string objects. You should no be able to see that the character "-" is not going to appear between each letter because it exists alone only on the first assignment to line. print(line) Python passes the reference held by line to the print function which uses the default representation for output whatever latest iteration of the string object line references at that point. More on reddit.com
๐ŸŒ r/learnpython
4
2
January 30, 2023
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ string
Python Data Type: String - Exercises, Practice, Solution - w3resource
June 12, 2025 - Python String Exercises, Practice, Solution - Improve your Python string handling skills with these 113 exercises, each with a sample solution. Learn how to calculate string length, count character frequencies, extract substrings, replace characters, swap characters, and more.
๐ŸŒ
LearnPython.com
learnpython.com โ€บ blog โ€บ python-string-exercises
15 Python String Exercises for Beginners | LearnPython.com
April 29, 2024 - Be sure to check the courses out if youโ€™re on the lookout for even more coding practice. Together, they include over 20 hours of content and 84 Python string exercises, including full solutions and explanations. The 15 Python string exercises in the sections below are aimed at beginners.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python-string-exercise
Python String Exercise - GeeksforGeeks
December 19, 2024 - To help you improve, try these Python exercises with solutions to test ... List OperationsAccess List ItemChange List itemReplace Values in a List in PythonAppend Items to a listInsert Items to a listExtend Items to a listRemove Item from a listClear entire listBasic List programsMaximum of two numbersWays to find length of listMinimum of two numbersTo interchange first an ... Basic String ProgramsCheck whether the string is Symmetrical or PalindromeFind length of StringReverse words in a given StringRemove iรขย€ย™th character from stringAvoid Spaces in string lengthPrint even length words in a stringUppercase Half StringCapitalize the first and last character of each word in
๐ŸŒ
HolyPython
holypython.com โ€บ home โ€บ beginner python exercises โ€บ exercise 9: strings
Improve your Python skills with Exercise 9: Strings | HolyPython.com
April 4, 2024 - ... All you need to do is make sure your string is inside quotation marks. ... By using first, second and last characters of the string, create a new string. ... You can add strings by using (+) character.
๐ŸŒ
Medium
medium.com โ€บ @nishithakalathil โ€บ python-string-exercises-788ae4e1922d
Python String Exercises. This page is your ticket to becoming aโ€ฆ | by Nishitha Kalathil | Medium
September 26, 2023 - 18. Given three strings, write a program to check if the third string can be formed by interleaving the characters of the first two strings.
๐ŸŒ
Python Lobby
pythonlobby.com โ€บ home โ€บ python string exercises with solution
Python String Exercises with Solution - Python Lobby
April 27, 2021 - num = input("Enter a String ") x = [] for i in range(len(num)): if num[i].isupper(): x.append(num[i].lower()) elif num[i].islower(): x.append(num[i].upper()) # printing result for i in range(len(x)): print(x[i], end=' ') Hint Input: Enter a String: I am a boy Enter a word to search: boy ... num = input("Enter a string ").split() search = input("Enter a word to search ") if search in num: print(f"{search} exist in String") else: print(f"{search} not exist in String") ...
Find elsewhere
๐ŸŒ
W3Schools
w3schoolsua.github.io โ€บ python โ€บ python_strings_exercises_en.html
Python - String Exercises. Lessons for beginners. W3Schools in English
Python - String Exercises. Python has many built-in methods that you can use on strings. Examples. Brief description of the method. Examples. Lessons for beginners. W3Schools in English
๐ŸŒ
GitHub
github.com โ€บ Asabeneh โ€บ 30-Days-Of-Python โ€บ blob โ€บ master โ€บ 04_Day_Strings โ€บ 04_strings.md
30-Days-Of-Python/04_Day_Strings/04_strings.md at master ยท Asabeneh/30-Days-Of-Python
I teach %s' %(first_name, last_name, language) print(formated_string) # Strings and numbers radius = 10 pi = 3.14 area = pi * radius ** 2 formated_string = 'The area of circle with a radius %d is %.2f.' %(radius, area) # 2 refers the 2 significant digits after the point python_libraries = ['Django', 'Flask', 'NumPy', 'Matplotlib','Pandas'] formated_string = 'The following are python libraries:%s' % (python_libraries) print(formated_string) # "The following are python libraries:['Django', 'Flask', 'NumPy', 'Matplotlib','Pandas']"
Author: Asabeneh
๐ŸŒ
Real Python
realpython.com โ€บ courses โ€บ python-exercises-string-methods
Python Basics Exercises: Strings and String Methods โ€“ Real Python
December 1, 2023 - In this Python Basics Exercises course, you'll review how to work with the string data type. You'll practice manipulating strings with methods and formatting them for printing.
๐ŸŒ
Codesolid
codesolid.com โ€บ python-string-examples-tutorial-and-practice-exercises
Python String Examples: Tutorial and Practice Exercises โ€” CodeSolid.com 0.1 documentation
In this tutorial, weโ€™ve covered in detail what strings are in Python and the different mechanisms for working with them. Including string operators, built-in functions and methods, indexing, and slicing. Make sure to go through and solve all of these exercises.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ python_string_exercises.htm
Python - String Exercises
Python program to find number of vowels in a given string. mystr = "All animals are equal. Some are more equal" vowels = "aeiou" count=0 for x in mystr: if x.lower() in vowels: count+=1 print ("Number of Vowels:", count)
๐ŸŒ
Tutorjoes
tutorjoes.in โ€บ python_programming_tutorial โ€บ string_programs_in_python
Python : String - Exercises and Solution
If the substring is not found in the given string Not found. ... 43. Write a Python program to print four values decimal, octal, hexadecimal (capitalized), binary in a single line of a given integer.
๐ŸŒ
Pythonista Planet
pythonistaplanet.com โ€บ 15-python-string-manipulation-exercises-and-examples
15 Python String Manipulation Exercises and Examples โ€“ Pythonista Planet
May 10, 2023 - myString = "Hello, Python!" endsWith = myString.endswith("Python!") print("Does the string end with 'Python!'? :", endsWith) ... I hope this article was helpful. Check out my post on 10 Python Set Exercises and Examples.
๐ŸŒ
PYnative
pynative.com โ€บ home โ€บ python exercises โ€บ python basic exercise for beginners: 40 coding problems with solutions
Python Basic Exercise for Beginners: 40 Coding Problems with Solutions
February 8, 2026 - Practice Problem: Write a program to find how many times the substring โ€œEmmaโ€ appears in a given string. Exercise Purpose: Text analysis and pattern matching are core pillars of programming. This exercise introduces searching for a โ€œneedle in a haystack,โ€ a fundamental concept for building search engines or data validation tools. ... Python strings have a built-in method called .count() that can search for occurrences of a specific sequence of characters.
๐ŸŒ
Freelearningpoints
freelearningpoints.com โ€บ python โ€บ exercises โ€บ basic
Python String Exercise and Answer - freelearningpoints
Python Exercises: Python String Exercises Python List Exercises Python Library Exercises Python Sets Exercises Python Array Exercises Python Condition Statement Exercises Python Lambda Exercises Python Function Exercises Python File Input Output Exercises Python Tkinter Exercises Numpy Exercises: Numpy String Exercises Numpy Integer Exercises Numpy Array Exercises Numpy Data Analysis Exercises Numpy Data Sorting Exercises Pandas Exercises: Pandas Series Exercises Other Tutorials: Programming Languages Introduction Python Introduction Python Installation - Windows Python Installation - Linux (U
๐ŸŒ
Almettkidscoding
almettkidscoding.github.io โ€บ basics โ€บ wrapup_exercise_string
Wrap up Exercise - string :: Python programming
# Reverse the given string def reverse_string(string): # CHeck if the first string is reverse of the second string # Return True of False def reverse_check(string1, string2):
๐ŸŒ
Tutorials
zframez.com โ€บ tutorials โ€บ chapter 7: working with strings in python
Chapter 7: Python String Manipulation โ€“ Methods and Operations
October 16, 2024 - This Python tutorial explains how to work with strings, including slicing, joining, and case conversion. Explore string methods like find, count, replace, and more.
๐ŸŒ
Jeshuat
jeshuat.github.io โ€บ Experimentation1 โ€บ content โ€บ 06_strings โ€บ strings_python_exercises.html
Python exercises: Strings โ€” Experimentation 1
Adapt the program you wrote in the previous chapter to present a moving text of 40 characters long that runs like a circle from left to right: when characters reach the end they starts to appear at the beginning again. Work step by step! If you do not know where to start, assume you want to print the string โ€œ1234โ€ and write out what should be the values (use a piece of paper!), like this sketch: If the script works for โ€œ1234โ€, you can change the code to make it work for a string of any length e.g.