classification
Title: not able to execute print command on page 16 of documentation
Type: compile error Stage: resolved
Components: Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Vishal Devgn, steven.daprano
Priority: normal Keywords:

Created on 2017-06-25 11:11 by Vishal Devgn, last changed 2017-06-25 11:26 by steven.daprano. This issue is now closed.

Files
File name Uploaded Description Edit
1.png Vishal Devgn, 2017-06-25 11:11 png image from python 3.6
Messages (2)
msg296821 - (view) Author: Vishal Devgn (Vishal Devgn) Date: 2017-06-25 11:11
>>> a, b = 0, 1
>>> while b < 1000:
... print(b, end=',')
... a, b = b, a+b

in 3.6 as soon as i write print command, it displays an indentation error.
msg296822 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2017-06-25 11:26
This is a bug in your code, not Python, and the error tells you how to fix it. You have to indent the block.

>>> while b < 1000:
...     print(b, end=',')
...     a, b = b, a+b

Remember to press TAB or spacebar inside indented blocks.

You should work through the tutorial.

https://docs.python.org/3/tutorial/index.html

By the way, you say page 16 of which documentation? Are you reading from a book? Which book?
History
Date User Action Args
2017-06-25 11:26:20steven.dapranosetstatus: open -> closed

nosy: + steven.daprano
messages: + msg296822

resolution: not a bug
stage: resolved
2017-06-25 11:11:27Vishal Devgncreate