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:
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!