Python input() Function

Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python

Program 1

print("Enter First No")
a=int(input())
print("Enter Second No")
b=int(input())
c=a+b
print(c)

Program 2

a=int(input("Enter First Number"))
b=int(input("Enter Second Number"))

print("Before Swaping ",a ," ",b)
#c=a
#a=b
#b=c

#a=a+b
#b=a-b
#a=a-b

a,b=b,a

print("After Swaping ",a ," ",b)   

Program 3

a,b=input("Enter two Number").split(',')
a=int(a)
b=int(b)
c=a+b
print("Addition is : ",c)

Program 4

r=float(input("Enter redious"))
A=3.14*r*r
print("Area is ",A)

 

Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *