ryguy7272 <ryanshu...@gmail.com> wrote: >PERFECT!! SO SIMPLE!! >I don't know why the author didn't do that in the book.
The book is evidently giving you code snippets to enter into Python's own interactive interpreter, i.e., you enter "python" at the command line, then you manually type each command which immediately displays any returned value. I assume that the book shows each command with three chevrons ">>>" in front of them. If you're using Spyder then you need to enter the commands into its interactive interpreter (which I think is bottom right). It sounds, instead, as though you're using Spyder's text editor to create a file containing the commands, and then using the "run" icon to run the file -- which is maybe skipping ahead because the book hasn't told you how to do that yet (?). If you do skip ahead, the book probably has a forthcoming chapter called "writing programs with a text editor" or something. I'd guess from the code snippets that you've shown us that the book is finance oriented, and the author seems to be more interested in introducing the features useful for finance than teaching the basics of Python. Maybe you should search out a simple Python primer on the web, work through that, and only then return to your book. -- https://mail.python.org/mailman/listinfo/python-list