0% found this document useful (0 votes)
7 views2 pages

Python Programs

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Python Programs

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

PYTHON PROGRAMS

#program to print full name

firstname=input("enter firstname")

lastname=input("enter lastname")

print("Fullname is ",firstname+lastname)

2.

# Program to find the sum of two numbers

n1=10

n2=20

result=n1+n2

print("sum of numbers is ", result)

3.

#PROGRAM TO ADD TWO NUMBERS

x=int(input("enter x"))

y=int(input("enter y"))
z=x+y
print("sum is ", z)

4.

#PROGRAM TO ADD TWO NUMBERS

x=int(input("enter first value"))

y=int(input("enter second value"))

z=x+y

print("sum of", x ,"and", y ,"is", Z)

5.

x=int(input("enter first value"))

y=int(input("enter second value"))

z=x*y

print(“Product of", x ,"and", y ,"is", Z)


6.

#PROGRAM TO SUBTRACT TWO NUMBERS

x=int(input("enter first value"))

y=int(input("enter second value"))

z=x-y

print(“Difference between", x ,"and", y ,"is", Z)

You might also like