April 24, 2026

Conditional Statements in Python (Clinical Decision Making, Dose Adjustment, Toxicity Check)

Conditional Statements in Python for Pharmacy Students (Clinical Decisions, Dose Adjustment & Toxicity Check)

Conditional statements in Python allow decision-making based on specific conditions. In pharmaceutical sciences, they are widely used for clinical decision support, dose adjustments, and toxicity monitoring.


๐Ÿ”ท What are Conditional Statements?

Conditional statements execute code based on whether a condition is True or False.

if condition:
    statement
๐Ÿ’ก Key Insight: Conditional statements mimic clinical decision-making processes.

๐Ÿ”ท if Statement

Executes code only if condition is true.

temperature = 102

if temperature > 100:
    print("Fever detected")

๐Ÿ”ท if-else Statement

Executes one block if true, another if false.

age = 30

if age > 60:
    print("Reduce dose")
else:
    print("Normal dose")

๐Ÿ”ท if-elif-else Statement

Used when multiple conditions exist.

temperature = 101

if temperature > 103:
    print("High fever")
elif temperature > 100:
    print("Mild fever")
else:
    print("Normal")

๐Ÿ’Š Dose Adjustment Example

age = 65

if age > 60:
    print("Reduce dose")
else:
    print("Standard dose")

๐Ÿ’Š Toxicity Check Example

concentration = 15

if concentration > 10:
    print("Toxic level")
else:
    print("Safe level")

๐Ÿ’Š Combined Clinical Condition

age = 70
kidney_issue = True

if age > 60 and kidney_issue:
    print("Reduce dose significantly")

๐Ÿง  Memory Trick

  • if โ†’ Decision
  • elif โ†’ Multiple options
  • else โ†’ Default action

๐Ÿงช Practice Exercise

Create a program that:

  • Takes patient temperature
  • Displays fever condition

๐Ÿ“ MCQs

  1. Which keyword is used for decision-making?
    a) loop
    b) if
    c) def
    d) print
    Answer: b

  2. elif stands for:
    a) else if
    b) end if
    c) else loop
    d) exit if
    Answer: a

  3. Which condition checks toxicity?
    a) if dose
    b) if concentration > limit
    c) if drug name
    d) print()
    Answer: b

โ“ FAQs

Why are conditional statements important in pharmacy?

They help in clinical decision-making such as dose adjustment and toxicity monitoring.

What is the difference between if and elif?

if checks the first condition, while elif checks additional conditions.


๐Ÿ“ฅ Download Clinical Logic Practice Problems

Includes dose adjustment and toxicity scenarios.


โžก Next Topic: Nested Conditional Statements โ†’

Unit 2 Blog:

Question Bank Unit 2: Control Structures & Functions

For more details: Basics of Python Programming for Pharmaceutical Sciences