CJCoding With Joseph
15free / daySign inCreate account

Longest Name

The second element of the list names is read from input() with no prompt. Find the longest name with a for loop, comparing lengths from len() and keeping the current best in longest, which starts as the first name; when lengths tie the earlier name stays. After the loop print <name> has <n> letters. Input: one line, a name.

Expected Output:

Giselle has 7 letters

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
Lists
📥 Auto-Input:
Giselle\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.