Length of String
Beginner
Length of String
Hello, young coders! Today, we have a fun challenge involving strings, which are basically a sequence of characters. Think of all the words and sentences you know. Each of those is a string in computer terms!
Your mission, should you choose to accept it, is to write a function called string_length that finds out the number of characters in a given string. This includes spaces, punctuation, and any special symbols.
Examples
Here's what you need to do:
string_length("Hello, world!")
This should return:
13
And for another example:
string_length("Python is fun!")
This should return:
14
Are you ready to count some characters? Solve the mystery of the string length by implementing this function!
Inputs
Arg 1:
"Hello, world!"Expected Output
13Actual Output