Skip to content

NameError: name 'xrange' is not defined #28

Closed
@malhotrachetan

Description

@malhotrachetan

Hey everyone, I was going through the: 'Making plots with matplotlib' part of python docs and in the section: 'First Histogram'
screen shot 2017-05-02 at 3 36 19 am

it throws an error:
screen shot 2017-05-02 at 3 37 59 am

I guess in data = [random.random() for i in xrange(2000)], data should be declared as: data = [random.random() for i in hg.xrange(2000)]

Plus after executing the ditto code from docs, the plot looks something likes this:

screen shot 2017-05-02 at 3 40 42 am
instead of:
screen shot 2017-05-02 at 3 41 09 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions