Python Questions

Hi Josh

Thanks for your email. Here i would like to attach some print screen files to check with you about the sample questions that i ran at PyCharm it shows some errors even though i follow the syntax from the tutorials. Can you please kindly go through it and let me know. Thank you.

Best

Chung

1 Like

Hi Chung,

Welcome to the forum!

It looks to me that your error is coming from a different file than what you have open.
It appears that you have more than one file named test.py, in different directories, and that you’re running the one that is in Pycharm’s open directory (not pictured in the screenshot).

1 Like

That looks like the problem. To fix it, you can run the program in the current tab by pressing ctrl-shift-F10.

Pycharm is running the test.py file here (probably open in the tab all the way on the left):

C:/Users/Chung/Pycharm/Projects/practice/test.py

You can tell where that file is by the output at the bottom:

The editor tab is showing the test.py file here:

C:/Users/Chung/Desktop/python practice/test.py

You can tell where the file in the tab is located by the “breadcrumbs” at the top: