Basic Python Programming(313011) Practical No 2: Write simple Python program to calculate equivalent registers connected in series and parallel Accept values of R1, R2 and R3 from the user
The practical significance of using operators in Python includes performing essential mathematical and logical computations, enabling complex decision-making in control flow, and facilitating data manipulation and low-level programming tasks. Additionally, membership and identity operators enhance efficiency in data structure operations. Overall, operators contribute to code readability and conciseness, making Python powerful for various applications.
Practical related Questions
1. Mention the use of //, **, % operator in Python.
Answer:
2. Write a Python program to calculate the final price after applying a discount. The user inputs the original price and the discount percentage.
Answer:
3. Write a Python program to compare the ages of two people. The user inputs the ages, and the program prints who is older or if they are the same age.
Answer:
4. Given `x = 5` and `y = 8`, how would you express whether `x` is less than or equal to `y`?
Answer:
x = 5
y = 8
result = x <= y
print(result)
5. Write a Python program to check if a number `num` is greater than `10` and less than `20`.
Answer:
1) Write simple Python program to calculate equivalent registers connected in series and parallel. Accept values of R1, R2 and R3 from the user.
Answer:
2) Write simple Python program to calculate value of voltage by applying Ohm’s law. Accept value of Current(I) and Resistance(R) from the user.
Answer:
3) Write a program to find the square root of a number.
Answer:
4) Write a program to find the area of the Rectangle.
Answer:
5) Write a program to calculate area and perimeter of the square.
Answer:
6) Write a program to calculate surface volume and area of a cylinder.
Answer:
7) Write a program to swap the value of two variables.
Answer: