'Syntax Error: invalid syntax' for no apparent reason

0 votes

I've been trying to get a fix and can't find why the error keeps appearing. Pmin,Pmax,w,fi1 and fi2 have all been assigned finite values

guess=Pmin+(Pmax-Pmin)*((1-w**2)*fi1+(w**2)*fi2)

When i remove this line from the code, the same error appears at the next line of code, again for no reason I can think of

Edit: Here is the chunk of code I was referring to:

def Psat(self, T):
   pop= self.getPborder(T)
   boolean=int(pop[0])
   P1=pop[1]
   P2=pop[2]
   if boolean:
      Pmin = float(min([P1, P2]))Pmax = float(max([P1, P2]))
      Tr=T/self.typeMolecule.Tc
      w=0.5*(1+scipy.tanh((10**5)*(Tr-0.6))) fi1=0.5*(1-scipy.tanh(8*((Tr**0.4)-1)))
     fi2=0.460*scipy.sqrt(1-(Tr-0.566)**2/(0.434**2)+0.494
     guess = Pmin+(Pmax-Pmin)*((1-w**2)*fi1+(w**2)*fi2)
     #error here 
     solution = scipy.optimize.newton(funcPsat,guess, args=(T,self))
Aug 13, 2018 in Python by bug_seeker
• 15,310 points
53 views

1 answer to this question.

0 votes

You're missing a close paren in this line:

fi2=0.460*scipy.sqrt(1-(Tr-0.566)**2/(0.434**2)+0.494

There are three ( and only two ).

I hope This will help you.

answered Aug 13, 2018 by Priyaj
• 56,160 points

Related Questions In Python

0 votes
1 answer

How to fix this? ValueError: invalid literal for int() with base 10 error in Python

The following are totally acceptable in python: passing ...READ MORE

answered Nov 16, 2018 in Python by Nymeria
• 3,500 points
7,478 views
0 votes
0 answers

What exactly is invalid syntax error?

Isnt it same as a nameerror, there ...READ MORE

Jun 12 in Python by Waseem
• 3,400 points
13 views
0 votes
0 answers

Python error "SyntaxError: invalid syntax"

I have a very simple python snippet: from ...READ MORE

Jul 5 in Python by Ruth
18 views
0 votes
1 answer

Python Pandas error: AttributeError: 'DataFrame' object has no attribute 'rows'

There is no attribute called “rows”. The ...READ MORE

answered Mar 28 in Python by Shri
1,173 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 125 views
+4 votes
6 answers
0 votes
1 answer

Python error: No handlers could be found for logger “xhtml2pdf”

The only solution is to define a ...READ MORE

answered Sep 5, 2018 in Python by Priyaj
• 56,160 points
130 views
0 votes
1 answer

Why is openpyxl is required for loading excel format files?

Well, it sounds like openpyxl is not ...READ MORE

answered Aug 8, 2018 in Python by Priyaj
• 56,160 points
87 views