Back to Freecodecamp

Step 8

curriculum/challenges/english/blocks/learn-string-manipulation-by-building-a-cipher/6551f6f9ec6db270eb83f3db.md

latest1.2 KB
Original Source

--description--

You can see 11 printed on the terminal because 'Hello World' contains 11 characters.

Another useful built-in function is type(), which returns the data type of a variable. Modify your print() call to print the data type of text.

--hints--

You should call the type() function.

js
assert.match(code, /type\s*\(.*\)/)

You should pass text to the type() function by including it between the parentheses.

js
assert.match(code, /type\s*\(\s*text\s*\)/)

You should pass type(text) to the print() function by including it between the parentheses. Pay attention to place the function call at the beginning of the line.

js
assert.match(code, /^print\s*\(\s*type\s*\(\s*text\s*\)\s*\)/m)

You should not have print(len(text)) in your code.

js
const commentless_code = __helpers.python.removeComments(code)
assert.notMatch(commentless_code, /print\s*\(\s*len\s*\(\s*text\s*\)\s*\)/)

Your code contains invalid syntax and/or invalid indentation.

js
({test: () => assert(true) })

--seed--

--seed-contents--

py
--fcc-editable-region--
text = 'Hello World'
print(len(text))
--fcc-editable-region--