📘 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
- Python is a:
a) Compiled language
b) Interpreted language
c) Assembly language
d) Machine language
Answer: b - Which of the following is NOT a data type?
a) int
b) float
c) real
d) string
Answer: c - Which function is used to take input?
a) print()
b) input()
c) read()
d) scan()
Answer: b - What is the type of “500”?
a) int
b) float
c) string
d) bool
Answer: c - Which is a valid variable?
a) 1dose
b) dose_1
c) dose-1
d) dose 1
Answer: b - Which operator is used for exponentiation?
a) ^
b) **
c) *
d) //
Answer: b - 5 > 3 and 2 < 1 gives:
a) True
b) False
Answer: b - Which method removes spaces?
a) remove()
b) strip()
c) clean()
d) trim()
Answer: b - Output of drug[0] for “Aspirin”:
a) A
b) s
c) p
d) Error
Answer: a - 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
- Explain Python installation and IDE setup.
- Explain variables and data types with pharma examples.
- Explain different types of operators with applications.
- Explain input-output operations with examples.
- Explain string manipulation techniques.
- 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
| Concept | Key Point |
|---|---|
| Variable | Stores data |
| Data Types | int, float, string, bool |
| Operators | Perform operations |
| input() | Takes data |
| print() | Displays data |
| pip | Installs libraries |
📥 Download Full Question Bank PDF
Includes answers, explanations, and additional practice questions.
- Installing Python
- Installing IDEs like Jupyter, VS Code, PyCharm
- Variables and Data types in Python
- Operators in Python
- Input & Output
- String Manipulation
- Libraries in Python
For more details: Basics of Python Programming for Pharmaceutical Sciences (Theory)