Python Assignment Operators
These operators are normally used to assign values to the variables.
Python Comparison Operator
Comparison operators are used to compare two values.
Python Logical Operator
Logical operators are normally used wherever there is a need to combine conditions into a single one.
Python Identity Operator
Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location
Python Membership Operator
Membership operators are used to test if a sequence is presented in an object
Python Bitwise Operator
Bitwise operators are used to compare (binary) numbers.
Let’s solve some basic programming problems,
Exercise your way out:
Q - Given an integer, n , perform the following conditional actions:
- If n is odd, print
- If n is even and in the inclusive range of 2 to 5 , print
- If n is even and in the inclusive range of 6 to 20 , print
- If n is even and greater than 20 , print
Q - eduAlgo is interested to buy a new plot of land for it’s brand new office. If the land has an area greater than 4 Sq. Kms, then the founder is going to buy that plot for the office. Create a program that calculated the area of the plot, provided the following,
- The plot can only be circular,rectangular,square and triangular shape. The user enters the plot category.
- Depending upon the plot category you have to take the required inputs for the area calculation from the user.
- And if the final area is greater than 4 Sq. Kms, then print “Accepted”, else print “Not Accepted”.
Q - Given the marks of a student for five subjects, write a program to check if the student is passed or failed ! Threshold to pass the exam is 35%.
We are here to help ! Be sure to check our website and don’t hesitate to ask any questions on our community platform. We provide personal mentoring and teaching too, in order to upgrade your skills. Vist www.edualgoacademy.com to get started.
Spotted a bug ? Great job, you found a bug. Please report it to us in our mail and we’ll fix it as soon as possible.