# printing integer value
print(12)
# printing float value
print(12.56)
# printing string value
print("Hello")
# printing boolean value
print(True)
Output
12
12.56
Hello
True
Arithmetic operations inside the print() on values
# adding and printing integer value
print(12+30)
# adding and printing float value
print(12.56+12.45)
# adding and printing string value
print("Hello"+"World")
# adding and printing boolean value
print(True+False)
Output
42
25.009999999999998
HelloWorld
1
Printing different types of variables
# variable with integer value
a=12
# variable with float value
b=12.56
# variable with string value
c="Hello"
# variable with Boolean value
d=True
# printing all variables
print(a)
print(b)
print(c)
print(d)
Output
12
12.56
Hello
True
Printing different types of variables along with the messages
# variable with integer value
a=12
# variable with float value
b=12.56
# variable with string value
c="Hello"
# variable with Boolean value
d=True
# printing values with messages
print("Integer\t:",a)
print("Float\t:",b)
print("String\t:",c)
print("Boolean\t:",d)
Printing different types of variables with messages and converting them to string using "str()" function
# variable with integer value
a=12
# variable with float value
b=12.56
# variable with string value
c="Hello"
# variable with Boolean value
d=True
# printing values with messages
print("Integer\t:"+str(a))
print("Float\t:"+str(b))
print("String\t:"+str(c))
print("Boolean\t:"+str(d))
Program:
Output
Arithmetic operations inside the print() on values
Output
Printing different types of variables
Output
Printing different types of variables along with the messages
Output
Printing different types of variables with messages and converting them to string using "str()" function
Output
need an explanation for this answer? contact us directly to get an explanation for this answer