Robotics & Artificial Intelligence
Predict the output of the following snippet:
wd="Robotics"
print(len(wd))
Python Functions
2 Likes
Answer
Output
8
Explanation
The len() function returns the number of characters in the string. The string "Robotics" contains 8 characters (R, o, b, o, t, i, c, s), so the output is 8.
Answered By
1 Like
Related Questions
Predict the output of the following snippet:
m=32 n=float(m) print(n)Predict the output of the following snippet:
a=42.85 b=int(a) print(b)Predict the output of the following snippet:
List1=["Happy", "New", "Year", 2026] print(len(List1))Python has a built-in type() function to ascertain the data type of a specific value. Predict the data type of the given Python statement:
m=32 n=float(m) print(type(n))