Why do we use %3.2f and %2.1f? Can we use any other value apart from these? I do understand that the value after the decimal represents the number of places to be displayed after the decimal point. But what is the use of 3 and 2??
print('The value of x is %3.2f' %x)What does 3 represent
10306 visits
Outline:Various output statements Print a string Print a string with newline character How to use format operators? Example for integer format Example for string format Example for float format Getting input from the user using Input()function Display a prompt to get the input Save the script as filename.py and execute using %run command
Various output statements Print a string Print a string with newline character How to use format operators? Example for integer format Example for string format Example for float format Getting input from the user using Input()function Display a prompt to get the input Save the script as filename.py and execute using %run command
Show video info
Pre-requisite