Challenge
Let's practice!
Tarefa
Swipe to start coding
Your code accepts the sentence from the user. You should define if it is short, medium, or large.
- Accept the text message from the user as input and store it in the variable
sentence. - Using the statement
ifand functionlength()we check if our statement is large. If the sentence’s length is greater than30, we print the message"The sentence is large!". - Using the statement
else ifand functionlength()we check if our statement is medium. If the sentence’s length is greater than10(but less than30), we print the message `"The sentence is medium!". - Using the statement
elseand functionlength()we check if our statement is short. If the sentence’s length is less than10, we print the message"The sentence is medium!".
Please, don’t forget to type the semicolon at the end of the lines.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 7
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Suggested prompts:
Resumir este capítulo
Explicar o código em file
Explicar por que file não resolve a tarefa
Awesome!
Completion rate improved to 3.33
Challenge
Deslize para mostrar o menu
Let's practice!
Tarefa
Swipe to start coding
Your code accepts the sentence from the user. You should define if it is short, medium, or large.
- Accept the text message from the user as input and store it in the variable
sentence. - Using the statement
ifand functionlength()we check if our statement is large. If the sentence’s length is greater than30, we print the message"The sentence is large!". - Using the statement
else ifand functionlength()we check if our statement is medium. If the sentence’s length is greater than10(but less than30), we print the message `"The sentence is medium!". - Using the statement
elseand functionlength()we check if our statement is short. If the sentence’s length is less than10, we print the message"The sentence is medium!".
Please, don’t forget to type the semicolon at the end of the lines.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 7
single