Recent content by UoPTucson

  1. UoPTucson

    Invalid syntax on hello world program

    There have been some definite changes between Python 2.x and Python 3.x. While you are in the Python 2.6 interpreter, your code works fine, but when you dropped into a terminal and started python, you got python 3.x so to be clear: Python 2.x: print 'Hello World' Python 3.x: print("Hello...
  2. UoPTucson

    What's Wrong With Such A Simple Code?

    What version of Python are you using? Python 2.x has the raw_input() function, but that was done away with in Python 3.x. In Python 3.x your code would be: var = input("Enter something: ") print ("you entered ", var) Note the () in the print function. this happens when you have Python run...
  3. UoPTucson

    Python Coding Problem- How To Convert Seconds Into Minutes, Hours, And Day?

    Your function is returning a tuple, not a single value.
  4. UoPTucson

    Please Help!

    Not sure what your problem is, as you did not say how this is failing. However, looking at the code, are you loading the file contents into a list or do you try to cycle through the file for each guess?
  5. UoPTucson

    adding a directory to sys.path

    I needed IDLE to be able to find the standard pip installed modules so I could import things like numpy, or matplotlib, etc., so this is what I did: sudo gedit /usr/local/lib/python3.6/site.py change the line: USER_SITE= NONE to: USER_SITE = '/usr/share'
Top