I'm new to Cloud 9/can't get program to run


#1

I’m trying to run this multiplication table in a file window. I’m trying to run it in python 2 and it just gives me an error that it cannot find the file :

for i in range(1, 10):
print “i =”, i, “:”,
for j in range(1, 10):
print “{:2d}”.format(i * j),
print

bash: line 1: A.Garcia - Assignment#2: command not found

Process exited with code: 127


#2

indentation was lost on the post


#3

I believe my problem is operator error but I don’t know how to fix it?


#4

When posting code in the forum, use 3 backticks to open and close code blocks:

for i in range(1, 10):
    print "i =", i, ":",
    for j in range(1, 10):
        print "{:2d}".format(i * j),
        print

If I copy the above code into my Python console it works. To run your python program try using python <program_path> command and make sure you are using the correct path.

Another way is to simply open the file in your editor and click the RUN button.


#5

Thanks for the assistance and advice BigChief45!

Still no go. I get this: I believe you are right about the path.


#6

The error is most likely due to the file’s name. It is better that you use lowercase letters for your file name and that you use a single word for it. If you need to use more words, separate them using underscores instead of spaces. For example:

agarcia_assignment2.py

Also make sure you add the .py extension to your Python programs.


#7

You are the master BigChief45! That got it running! Now to fine tune.

Thanks again!

Augustine Garcia

Rio Vista Middle School
Computer Science/Applications
Teacher & Student
805-981-1507
The greatest technology you will ever use is YOUR knowledge - A. Guerrero