Skip to Content
Strings & Console Output
Dot Notation

Let’s take a closer look at why you use len(string) and str(object), but dot notation (such as "String".upper()) for the rest.

lion = "roar" len(lion) lion.upper()

Methods that use dot notation only work with strings.

On the other hand, len() and str() can work on other data types.



On line 3, call the len() function with the argument ministry.

On line 4, invoke the ministry‘s .upper() function.

Folder Icon

Take this course for free

Already have an account?