print()
Each print()
command does two things: displays a value to the user AND moves the cursor down to the next line
However - we can modifiy the end of our print command
print(23)
print(33, end = "-")
print(43)
Explain the output that you can see.
So what does , end =
do??
So far we have been joining strings using the +,
but for a print statement we can display more than one piece of data without having to join.
print("Alicia")
print("Alicia", 9, end ="! ")
word = "frogs"
print ("Alicia", 9, word, end ="!")
Consider this output from the visualizer

We are no longing combining strings to create a new string - we are displaying different data types and commands to the user by connecting pieces with a ,
Last updated