63
100
To check that Python is installed, open a command line (typically by running the "Terminal" program), and cd to the google-python-exercises directory. Try the following to run the hello.py program (what you type is shown in bold): ~/google-python-exercises$ python3 hello.py Hello World ~/google-python-exercises$ python3 hello.py Alice Hello Alice
  • Safe
  • United States
  • Encrypted
  • 27 yrs old
  • 1 Site Rank
  • Report Card

63
100
Prelude. Welcome to Google's Python online tutorial. It is based on the introductory Python course offered internally. As mentioned on the setup page, this material covers Python 3.. If you're seeking a companion MOOC course, try the ones from Udacity and Coursera (intro to programming [beginners] or intro to Python).Finally, if you're seeking self-paced online learning without watching videos ...
  • Safe
  • United States
  • Encrypted
  • 27 yrs old
  • 1 Site Rank
  • Report Card

63
100
Python has a built-in string class named "str" with many handy features (there is an older module named "string" which you should not use). String literals can be enclosed by either double or single quotes, although single quotes are more commonly used. ... A google search for "python str" should lead you to the official python.org string ...
  • Safe
  • United States
  • Encrypted
  • 27 yrs old
  • 1 Site Rank
  • Report Card

63
100
Python has a great built-in list type named "list". List literals are written within square brackets [ ]. Lists work similarly to strings -- use the len() function and square brackets [ ] to access data, with the first element at index 0. (See the official python.org list docs.)
  • Safe
  • United States
  • Encrypted
  • 27 yrs old
  • 1 Site Rank
  • Report Card

63
100
The "del" operator does deletions. In the simplest case, it can remove the definition of a variable, as if that variable had not been defined. Del can also be used on list elements or slices to delete that part of the list and to delete entries from a dictionary. var = 6 del var # var no more!
  • Safe
  • United States
  • Encrypted
  • 27 yrs old
  • 1 Site Rank
  • Report Card

63
100
filenames = os.listdir(dir) -- list of filenames in that directory path (not including . and ..). The filenames are just the names in the directory, not their absolute paths. os.path.join(dir, filename) -- given a filename from the above list, use this to put the dir and filename together to make a path
  • Safe
  • United States
  • Encrypted
  • 27 yrs old
  • 1 Site Rank
  • Report Card

71
100
The class includes "writ­ten mate­ri­als, lec­ture videos, and lots of code exer­cis­es to prac­tice Python cod­ing. These mate­ri­als are used with­in Google to intro­duce Python to peo­ple who have just a lit­tle pro­gram­ming expe­ri­ence. The first exer­cis­es work on basic Python con­cepts like strings and lists ...
  • Safe
  • United States
  • Encrypted
  • 20 yrs old
  • 4,186 Site Rank
  • Report Card

83
100
I've seen plenty of examples of people extracting all of the classes from a module, usually something like: # foo.py class Foo: pass # test.py import inspect import foo for name, obj in inspect.getmembers(foo): if inspect.isclass(obj): print obj
  • Safe
  • United States
  • Encrypted
  • 20 yrs old
  • 88 Site Rank
  • Report Card

See more