When does '...' appear?

QuestionsQuestions8 SkillsProPython Control StructuresNov, 19 2025
075

The ... prompt appears in the Python interpreter when you are continuing a multi-line statement. This typically occurs in situations such as:

  1. When you open a parenthesis, bracket, or brace and do not close it on the same line.
  2. When you are defining a function or a class and have not completed the definition.
  3. When you are using a continuation character (like a backslash \) to split a statement across multiple lines.

For example:

>>> def my_function():
...     print("Hello, World!")
...

In this case, the ... indicates that you are still inside the function definition.

0 Comments

no data
Be the first to share your comment!