CMPT-101 Lecture 5: Functions and Characters
Document Summary
Adding t after a backslash in a statement adds a tab space. Adding n after a backslash in a statement adds a new line. Print is the command in python used to display whatever in inside the parentheses following print. Replaces the end of a line of a print function with something else. Where a print function would normally end and make a new line for the next print function, including end=" " for example would replace this with a space. >>>print("how are you today") hello how are you today. Outside of a string, but inside of a line, we can use this to replace the spaces (again, the spaces outside of a string) with whatever the value of sep is. >>>print("this is the story of", name, "who lives in alberta. ", sep="--") this is the story of--bob--who lives in alberta.