Exercise 1.9 - explore modules

From the sys module find out the:

  • the current version of Python

  • the name of the platform you’re running on

  • the default encoding (ASCII or Unicode)

  • the location of the Python executable currently running

From the os module find the:

  • current working directory

  • the current environment variables (paths , proxies etc.) for your operating system

Work out from numpy.random how to generate:

  • a set of random numbers with shape = [2,3] (NB rand() won’t work for this)

  • a random integer between 5 and 10

Go to Solution 1.9


Back to top