[Tutor] How to convert the fortran logic to python definition

DL Neil PyTutor at danceswithmice.info
Thu Mar 26 19:00:00 EDT 2020


On 27/03/20 10:16 AM, SATYABRATA DATTA wrote:
> delta=18.*a*b*c*d-4.*(b**3)*d+b**2*c**2-4.*a*c**3-27.*a**2*d**2
>           print *, delta, a, b, c, d,d1
>           if(delta.gt.0.)then
>           x=2.*b**3-9.*a*b*c+27.*a**2*d
>           y=3.*sqrt(3.)*a*sqrt(delta)
>           if((x.lt.0.and.y.lt.0).or.(x.lt.0.and.y.gt.0))then
>           nii=2
>           else
>           nii=0
>           endif
> How to convert this fortran logic to python where delta(a,b,c,d)
> should return x(a,b,c,d) and y(a,b,c,d) for the next job when
> satisfied the conditions


As requested previously, please copy-paste actual code, because the 
above has become unnecessarily hard to comprehend.

I'm not sure that I've correctly understood your question.

The logic does NOT need to change. The two languages/code-snippets 
are/will be remarkably similar.

Are you actually asking that someone to write the Python code for you?
-- 
Regards =dn


More information about the Tutor mailing list