python - Using if-condition to check filename -


I am making a real mistake in Python, but can not figure out what it is

  filename = "file1" if name == 'file1' print1  

I am getting an invalid syntax error

What's the name ?? Do you define it elsewhere? I instead consider "filename", so

if "name" is then

  filename = "file1" If defined, then the problem is actually "if" at the end of the line ":". 


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -