Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Conditional evaluation
#1
Good day. Please tell me how to correctly compute with the condition? there is a code:
a1 = float(result1[0] * 0.1)
b1 = float(row[2])
c1 = b1 - a1
print (f'{c1:.lf}')
How to make a condition if c = negative value, then write to the database, if positive, then use the formula:
с1 = b1 - 6553.5 - a1
and write the result to the database
Reply


Messages In This Thread
Conditional evaluation - by stsxbel - May-31-2021, 01:28 AM
RE: Conditional evaluation - by perfringo - May-31-2021, 06:00 AM
RE: Conditional evaluation - by stsxbel - May-31-2021, 07:43 AM
RE: Conditional evaluation - by Gribouillis - May-31-2021, 09:07 AM
RE: Conditional evaluation - by stsxbel - Jun-03-2021, 03:58 AM
RE: Conditional evaluation - by snippsat - Jun-03-2021, 04:38 AM
RE: Conditional evaluation - by stsxbel - Jun-13-2021, 06:56 PM
RE: Conditional evaluation - by Gribouillis - Jun-13-2021, 08:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  UndefinedEnvironmentName: 'extra' does not exist in evaluation environment EarthAndMoon 3 1,732 Oct-09-2023, 05:38 PM
Last Post: snippsat
  Evaluation of two different list in python? go127a 8 3,664 Apr-22-2019, 12:49 PM
Last Post: snippsat
  list evaluation go127a 2 2,496 Apr-12-2019, 11:13 AM
Last Post: DeaD_EyE
  operand evaluation order? insearchofanswers87 2 2,864 Sep-26-2018, 07:51 PM
Last Post: insearchofanswers87
  Recursive evaluation in parsley parser mqnc 0 2,596 Apr-13-2018, 09:02 PM
Last Post: mqnc
  Learning Python, newbie question about strings and evaluation new_learner_999 13 6,017 Feb-18-2018, 03:01 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020