1. Two consecutive print () functions Why is the content displayed at the output?
Solution: Print () has two default parameters Sep and end, where Sep is the substitution delimiter, end is instead of the end of the newline character, by default, ', ' instead of a space, and the default end with a newline character, the End function is used to define the end of a line of output.
' Coffee ' Print ("I Love my"! ) ", sep="*") " "" "" "
2. How to get two print () functions in one line
Solution: You can use the end parameter to change the default newline character to a space or a blank .
Print ('hello'"") Print ('World '"*") Print ('! ' ) """"""
3. Example: Print the 9*9 multiplication table:
# Output 9*9 multiplication table. for in range (1,10): for in range (1,i+1): Print("{}*{}={}". Format (i, J, I * j), end="") Print ()
Python prints the output of two print () functions in one line