Click Here to Login
Join Computer forums Today

View Single Post
Old 03-13-2013, 02:11 PM   #1
Beta Member
Join Date: Mar 2013
Posts: 4
Default Python "if" problem

I have just started working on a program in Python that calculates various types of interest. Every time I try to run it, it tells me that there's an invalid syntax and it highlights the red "if". If I delete that line of code completely, it then tells me that "print" is invalid. If I delete that, it tells me that the "def" in front of "main()" is invalid, and so on and so forth....

I've never run into this problem before, and I'm very confused. I've rewritten the program a few different ways and each time it highlights something that it shouldn't, like a correctly written statement or variable. I assume this is something simple that I'm overlooking, but I'm completely baffled nonetheless.

Please help me figure out what's going on here.

Side note: I've run other programs I've made, and even wrote a short test program with similar functions to make sure the program or computer wasn't at fault and everything worked fine in all of the other programs. This leads me to believe something is wrong within the program.

I am somewhat new to programming so please speak in somewhat layman's terms for me.
Attached Images
File Type: jpg image-2832960814.jpg (53.7 KB, 15 views)
swinefire is offline   Reply With Quote

All times are GMT -5. The time now is 07:20 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2019, vBulletin Solutions, Inc.