LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2007, 09:03 AM   #1
Tortanick
Member
 
Registered: Jul 2006
Distribution: Debian Testing
Posts: 299

Rep: Reputation: 30
python syntax error, what am I doing wrong?


This is part of a program I'm writing for fun

Code:
def findlaststartday(month):
	if month == 1:
		return(findlaststartday2(laststartday, december)
	elif month == 2:
		return(findlaststartday2(laststartday, january)
	elif month == 3:
		return(findlaststartday2(laststartday, febuary)
	elif month == 4:
		return(findlaststartday2(laststartday, march)
	elif month == 5:
		return(findlaststartday2(laststartday, april)
	elif month == 6:
		return(findlaststartday2(laststartday, may)
	elif month == 7:
		return(findlaststartday2(laststartday, june)
	elif month == 8:
		return(findlaststartday2(laststartday, july)
	elif month == 9:
		return(findlaststartday2(laststartday, august)
	elif month == 10:
		return(findlaststartday2(laststartday, september)
	elif month == 11:
		return(findlaststartday2(laststartday, october)
	elif month == 12:
		return(findlaststartday2(laststartday, november)
When I try to run that program I get the error

Code:
  File "19.py", line 62
    elif month == 2:
       ^
I can't understand how elif month == 2: could give a syntax error, could someone please explain what I'm doing wrong?
 
Old 04-03-2007, 10:37 AM   #2
Tortanick
Member
 
Registered: Jul 2006
Distribution: Debian Testing
Posts: 299

Original Poster
Rep: Reputation: 30
never mind I fixed it myself

return(findlaststartday2(laststartday, december)

should have been

return(findlaststartday2(laststartday, december))
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
is this redirect syntax wrong? neocontrol Linux - Server 9 03-06-2007 11:19 AM
syntax error in string trim and wrong node routing agent in tcl script newbie06 Linux - General 0 02-23-2007 02:00 AM
MySQL not starting, wrong syntax??? riscphree Linux - Software 2 12-21-2005 08:13 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
What's wrong with this iptables syntax?? registering Linux - Security 3 06-16-2004 03:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration