The print() function is used to print text, numbers, and other objects to the screen.
It is a very useful tool when it comes to finding programming errors and to report on the development of the program.
The sep parameter indicates which character to use to separate the various objects that will be printed on the screen. Default is white space.
The end parameter indicates which character to use at the end of printing. It defaults to a new line '\n', but it can be replaced with an empty string '' so that successive
>>> print('Hola, mundo') Hola, mundo >>> print(3 + 5.6) 8.6 >>> print(1, 2, 3, 4, sep=' + ') 1 + 2 + 3 + 4 >>> print('Hola,'); print('mundo') Hola, mundo >>> print('Hola,', end=' '); print('mundo') Hola, mundo
Write a program that prints multiple numbers separated by commas using the
Write a program that prints two words together on a single line. The first and second words must be printed with two separate
Write a program that calculates and prints the mean of three grades: 5, 8, 9
Write a program that prints 'Hello world' on two separate lines with a single
Hint: the '\n' character is used to add a new line to a text string.
Write a program that assigns two values to two variables and then prints their values and the value of the sum.
a = 9 b = 7 print( ... )
La suma de 9 y de 7 es igual a 16