What are useful basic python commands>

What are useful basic python commands>
0

#1

put some below for 37 python would be useful for review… th


#3

I’m not a Python guy, but …

There are “smart” quotes in your example. But that my just be a cut and past issue.

Also, I thought that Python uses input. I think raw_input is from older Pythons, but it may depend on which version you are using.

So, those may not be a problem.

The real problem is your final print. It is a function so it all needs to be wrapped in parentheses. Like print (STORY % (adj1, ... noun4))

That works, I think.


#5

Richard Gruet has very good quick-reference of Python on his home page:
http://rgruet.free.fr/

The reference can be downloaded as HTML, zipped HTML or PDF file. It is in English.


#6

for commonly used, I would say def (declare a function), class (declare a class that you can use to make objects), and import (import a library so you can use its functions and classes). for is another common and very useful command. there’s also a lot of good stuff in the standard library that is commonly used, like open() and close() for working with files, append() for adding to lists, argv for reading command line arguments, etc.


#7

I have found the Programiz Python Built-In Methods compendium to be pretty useful for reference (Python 3.6, I believe). On the right-hand side there is a navigator that divides up the methods by object type.