April 24, 2026

UNIT 1: Python Programming Basics (COMPLETE QUESTION BANK)

📘 Unit 1 Question Bank – Python Programming Basics

Designed for B. Pharm students: MCQs, short answers, long answers, and case-based questions with pharmaceutical applications.


🔷 Section A: MCQs

  1. Python is a:
    a) Compiled language
    b) Interpreted language
    c) Assembly language
    d) Machine language
    Answer: b

  2. Which of the following is NOT a data type?
    a) int
    b) float
    c) real
    d) string
    Answer: c

  3. Which function is used to take input?
    a) print()
    b) input()
    c) read()
    d) scan()
    Answer: b

  4. What is the type of “500”?
    a) int
    b) float
    c) string
    d) bool
    Answer: c

  5. Which is a valid variable?
    a) 1dose
    b) dose_1
    c) dose-1
    d) dose 1
    Answer: b

  6. Which operator is used for exponentiation?
    a) ^
    b) **
    c) *
    d) //
    Answer: b

  7. 5 > 3 and 2 < 1 gives:
    a) True
    b) False
    Answer: b

  8. Which method removes spaces?
    a) remove()
    b) strip()
    c) clean()
    d) trim()
    Answer: b

  9. Output of drug[0] for “Aspirin”:
    a) A
    b) s
    c) p
    d) Error
    Answer: a

  10. pip is used for:
    a) Writing code
    b) Installing libraries
    c) Debugging
    d) Compiling
    Answer: b

🔷 Section B: Short Answer Questions

  • Define Python interpreter.
  • What is an IDE? Give examples.
  • Explain variables with example.
  • List different data types.
  • What is type casting?
  • Explain input() and print().
  • Define string.
  • What is pip?
  • Differentiate int and float.
  • Write syntax for installing a library.

🔷 Section C: Long Answer Questions

  1. Explain Python installation and IDE setup.
  2. Explain variables and data types with pharma examples.
  3. Explain different types of operators with applications.
  4. Explain input-output operations with examples.
  5. Explain string manipulation techniques.
  6. Explain Python libraries and their importance.

🔷 Section D: Case-Based Questions

💊 Case 1: Dose Calculation

Patient weight = 70 kg, Dose = 5 mg/kg

  • Write Python code
  • Identify data types
  • Which operator is used?
💊 Case 2: Patient Data Entry
  • Write program using input/output
  • Identify data types
  • Explain need of type conversion
💊 Case 3: Drug Name Cleaning

Input: ” paracetamol “

  • Remove spaces
  • Format text
  • Identify string methods
💊 Case 4: Clinical Decision
  • Age > 60 and kidney issue
  • Write condition
  • Identify operators

🔷 Section E: Mini Projects

  • Dose Calculator: Input weight → calculate dose
  • Patient Report Generator: Input details → display report
  • Drug Data Analyzer: Use NumPy → average dose

🧠 Quick Revision

ConceptKey Point
VariableStores data
Data Typesint, float, string, bool
OperatorsPerform operations
input()Takes data
print()Displays data
pipInstalls libraries

📥 Download Full Question Bank PDF

Includes answers, explanations, and additional practice questions.

  1. Installing Python
  2. Installing IDEs like Jupyter, VS Code, PyCharm
  3. Variables and Data types in Python
  4. Operators in Python
  5. Input & Output
  6. String Manipulation
  7. Libraries in Python

For more details: Basics of Python Programming for Pharmaceutical Sciences (Theory)