Learn
Strings & Console Output
str()

Now let’s look at str(), which is a little less straightforward. The str() method turns non-strings into strings! For example:

str(2)

would turn 2 into "2".

Instructions

1.

Create a variable pi and set it to 3.14 on line 4.

Call str(pi) on line 5, after print.

Folder Icon

Take this course for free

Already have an account?