In this video course, you’ve reinforced your knowledge of Python string objects.
You can now confidently access different characters in a string using indices
and slices, and you can determine the length of a string with len()
.
You also practiced methods. You used .upper()
and .lower()
to convert all characters of a string to uppercase and lowercase,
respectively. With .rstrip()
, .lstrip()
, and .strip()
, you removed
whitespace from strings, and you figured out if a string starts or ends
with a given substring through .startswith()
and .endswith()
.
You also practiced capturing input from a user as a string using the
input()
function, and you converted that input to a number using int()
and float()
. You converted numbers and other objects to strings using
str()
.
Finally, you used the .find()
and .replace()
methods to find
the location of a substring and replace a substring with a new string.
For more on these concepts, check out the following video courses:
- Reading Input and Writing Output in Python
- Python 3’s F-Strings: An Improved String Formatting Syntax
- Splitting, Concatenating, and Joining Strings in Python
- Check if a Python String Contains a Substring
- Replacing a String in Python
You can also read these tutorials:
- Basic Input, Output, and String Formatting in Python
- Python’s F-String for String Interpolation and Formatting
- Splitting, Concatenating, and Joining Strings in Python
- How to Read Python Input as Integers
- How to Check if a Python String Contains a Substring
- How to Replace a String in Python
To continue your Python learning journey, check out the other Python Basics courses. You might also consider getting yourself a copy of Python Basics: A Practical Introduction to Python 3.
Congratulations, you made it to the end of the course! What’s your #1 takeaway or favorite thing you learned? How are you going to put your newfound skills to use? Leave a comment in the discussion section and let us know.
emmanuel on Sept. 29, 2024
Hello/Hallo, I really liked this course .. I have questions as some of the solutions did not work for me (but i did not use repl, i used something named replit)
Exercice 4 of Task 1, with \ does not work… This below works :
Also when getting character from s string i thought it was mandatory to write
user_input[0:1]
but when I saw that you wrote[0]
… Anyway, i realised that you could chain methods and its a must ! Vielen Dank noch einmal!