Reference

print()

The print() function displays text, numbers, or other data on the screen.

Syntax

print(value1, value2, ..., sep=' ', end='\n')

Parameters

  • value1, value2, ... → The items to display.

  • sep (optional) → Separator between items. Default is a space " ".

  • end (optional) → What to print at the end. Default is a newline "\n".

input()

The input() function lets the user type something into the program. It always returns a string.

Syntax

variable = input(prompt)

Parameters

  • prompt (optional) → A message shown to the user before input.

Last updated