Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: String Cleaning | String Manipulation Essentials
Working with Strings and Data Formats

bookChallenge: String Cleaning

Building on your knowledge of string methods, you will now put your skills to the test by cleaning and standardizing raw user input. This is a common task in real-world data processing, where data often comes in messy or inconsistent formats. Your goal is to ensure that the input is tidy, consistent, and ready for further processing by applying a series of string transformations.

Aufgabe

Swipe to start coding

Write a function that takes a string and returns a cleaned version of it. The function must:

  • Remove any leading and trailing whitespace from the input string.
  • Convert all characters in the string to lowercase.
  • Replace all spaces in the string with underscores.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 5
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Suggested prompts:

What are some common string methods used for cleaning and standardizing input?

Can you give an example of how to clean and standardize a messy string?

What are the typical steps involved in processing raw user input?

close

Awesome!

Completion rate improved to 6.67

bookChallenge: String Cleaning

Swipe um das Menü anzuzeigen

Building on your knowledge of string methods, you will now put your skills to the test by cleaning and standardizing raw user input. This is a common task in real-world data processing, where data often comes in messy or inconsistent formats. Your goal is to ensure that the input is tidy, consistent, and ready for further processing by applying a series of string transformations.

Aufgabe

Swipe to start coding

Write a function that takes a string and returns a cleaned version of it. The function must:

  • Remove any leading and trailing whitespace from the input string.
  • Convert all characters in the string to lowercase.
  • Replace all spaces in the string with underscores.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 5
single

single

some-alt