Robotics & Artificial Intelligence
Predict the output of the following snippet:
m=32
n=float(m)
print(n)
Python Functions
1 Like
Answer
Output
32.0
Explanation
The float() function converts the integer value 32 stored in m into a floating-point number. Hence, the value of n becomes 32.0 which is displayed by the print() statement.
Answered By
2 Likes
Related Questions
When the arguments and parameters are with same variable names, they are known as:
- default arguments
- keyword arguments
- positional arguments
- None of them
State whether the following statements are True or False:
- A function cannot be defined without parameters.
- The return statement without parameter indicates a non-returnable function.
- A function can return only one value to its caller program.
- The parameters used in the function definition are called actual parameters.
- A function may or may not return a value to the main program.
- A function always contains the header and the footer.
Predict the output of the following snippet:
a=42.85 b=int(a) print(b)Predict the output of the following snippet:
wd="Robotics" print(len(wd))