Python Programs
Python Programs
Program
print(“cricket”, “football”, “badminton” ,“hockey”, sep=”,” , end=”……….”)
Output
2 2
3 3 3
Program
print(“\t \t 1\n\t 2\t2\n3\t3\t3”)
Output
1
2 2
3 3 3
6. List 7 Emirates in the UAE. (Use ‘--’ as a separator and ‘!!!!!!’ at the end)(HW)
Program
print(“Abu Dhabi”, “Dubai”, “Sharjah”,“Ajman”,“Umm Al Quwain” ,“Fujairah”, “Ras Al
Khaimah”, sep=”--” , end=”!!!!!!”)
Output
Program
a=200
b=100
sum=a+b
difference=a-b
product=a*b
division=a/b
modulus=a%b
print(“Sum=”,sum)
print(“Difference =”, difference)
print(“Product =”, product)
print(“Division =”, division)
print(“Remainder =”, modulus)
Output
Sum = 300
Difference = 100
Product = 20000
Division = 2.0
Remainder = 0
Program
a=100
b=200
c=300
d=200
print(a<b)
print(a>b)
print(b<=d)
print(b>=d)
print(c<=a)
print(c==d)
print(b==d)
print(c!=a)
print(d!=b)
Output
True
False
True
True
False
False
True
True
False
9. Write a Python program to read a name, Gr no and school name from the user side and print
those details.
print("Name:", name)
Output
10. Write a Python program to read a name and address from the user side and print those
details.
print("Name:", name)
print("Address:")
print("Area:", area)
print("Emirate:", emirate)
Output
Address
Output
12. Write a program to find the product of 3 floating point numbers. [Read numbers from the
user side]
Program
print("The product of", num1, ",", num2, "and", num3, "is:", product)
Result