Posts

Unit 2 | BP101T | Basic of Python Programming for Pharmaceutical sciences

Image
  CHAPTER 2: CONTROL STRUCTURES AND FUNCTIONS 2.1 Introduction to Control Structures In the previous chapter, we learned the basic concepts of Python programming, including variables, data types, input and output, operators, strings, libraries, and packages. In this chapter, we will learn how Python makes decisions, repeats instructions, and organizes code into reusable blocks using functions. In a Python program, statements are normally executed one after another, from top to bottom. However, real-world programs often require more flexibility. A program may need to make a decision based on a patient's temperature, repeat a calculation for several medicines, or perform the same operation multiple times. Python provides control structures to manage the flow of program execution. What are Control Structures? Control structures are programming statements that determine the order in which instructions are executed in a program. They allow a program to: Make decisions based on conditi...

Unit 1 | BP101T | Basic of Python Programming for Pharmaceutical sciences

Image
1.1 Introduction to Programming Programming is the process of writing a set of instructions that tells a computer how to perform a particular task. These instructions are written using a programming language . A computer does not understand ordinary human language directly. Therefore, programming languages are used to communicate instructions to a computer in a structured form. A program is a collection of instructions written to perform a specific task. For example, a simple Python program can be used to calculate the dose of a medicine based on the patient's body weight: weight = 60 dose_per_kg = 1000 dose = weight * dose_per_kg print("Required dose:", dose, "mg") In this example, the program calculates the required dose by multiplying the patient's weight by the dose required per kilogram. Programming is widely used in areas such as healthcare, pharmaceutical research, data analysis, artificial intelligence, and scientific computing. 1.2 Programming L...