Blog Archive

search

Tuesday, August 6, 2019

Python program to round off of a floating point number

x = 3.1415926
y = -12.9999
a="{:.0f}".format(x)
b="{:.0f}".format(y)
print(" Roundoff of ",x," = ",a)
print(" Roundoff of ",y," = ",b)

No comments:

Post a Comment

Python program to create a string from two given strings concatenating uncommon characters of the said strings

PROGRAM :  a = input('Enter a string : ') b = input('Enter a string : ') c='' for i in a:     if(i not in b):...