Great work! Now that we know how to store strings, let‘s see how we can change them using string methods.
String methods let you perform specific tasks for strings.
We‘ll focus on four string methods: len(),lower(),upper(),str()
len(‘Ryan‘),‘Ryan‘.lower(),‘Ryan‘.upper(),str(3.14)
Dot Notation
Methods that use dot notation only work with strings.
On the other hand, len()
and str()
can work on other data types.
Printing Strings
The area where we‘ve been writing our code is called the editor.
The console (the window in the upper right) is where the results of your code is shown.
print
simply displays your code in the console.
String Concatenation