Basics Of Python-3

Hello, I'm Priya Chakraborty, a dedicated B.Tech student in Electrical Engineering at Siliguri Institute Of Technology. I'm an enthusiastic learner, constantly seeking to expand my skill set and knowledge base. With a solid foundation in programming languages such as C, R, Python, and MySQL, I'm poised to tackle complex technical challenges.
But my passions extend beyond the realm of engineering. I'm also an aspiring content writer, driven by a curiosity to communicate ideas, both technical and non-technical, in a way that captivates and educates.
My journey is defined by a relentless pursuit of self-improvement, coupled with strong communication skills. I believe in the power of continuous learning and the importance of sharing knowledge.
DAY 3
Today, you will get to know about conditional statements in python.
Conditional Statement is nothing but if-else statements.
format of the if-else statement:
if (condition):
print("--")
else:
print("--")
so the format will look like this.
now let's solve a problem :
Write a python program to check whether the number is odd or even number-
n=int(input("enter the number"))
if n%2==0:
print("The number is even number")
else:
print("The number is odd number")
output:

Write a python program to check whether the given number is greater than 10 or not, if yes then print, "The number is greater than 10", else print -"The number is less than 10"-
n=int(input("Enter your number"))
if n>10:
print("The number is greater than 10")
else:
print("The number is less than 10")
output:

These are the basic programs solved by the if-else statement.
In the next blog, you will get to know about the nested if-else statement.
Thank you.




