What is %f


#1

is %f like %s only it uses a variable defined in a function?


#2

Hi @cloudrunner24055,

%f is meant for floats and %s is used for strings. They're just different variables used for different datatypes.

print "hi %f" %("bob") #will NOT work because "bob" is a string not a float

print "hi %s" %("bob") #Correct way because "bob" is a string.

print "number %f"(5.0) #will work because '5.0' is a float.


#3

In the Parameters and Arguments portion of the Functions lesson of the Python course, "%d" is used. Does this stand for integers? Are there any other "%'s"?


Should I have replied as a separate topic?