Challenge: Clean Up User Input
Compito
Swipe to start coding
Write a function that takes a sentence and returns a cleaned, formatted version.
- Remove extra spaces from the beginning and end of the sentence.
- Replace all sequences of multiple spaces between words with a single space.
- Replace every standalone "u" with "you" and "r" with "are", only when they appear as whole words.
- Capitalize the first letter of the sentence and make all other letters lowercase.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 2. Capitolo 6
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Fantastico!
Completion tasso migliorato a 4.76
Challenge: Clean Up User Input
Scorri per mostrare il menu
Compito
Swipe to start coding
Write a function that takes a sentence and returns a cleaned, formatted version.
- Remove extra spaces from the beginning and end of the sentence.
- Replace all sequences of multiple spaces between words with a single space.
- Replace every standalone "u" with "you" and "r" with "are", only when they appear as whole words.
- Capitalize the first letter of the sentence and make all other letters lowercase.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 2. Capitolo 6
single