Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Slicing and Search Drills | Strings
Data Types in Python

bookChallenge: Slicing and Search Drills

Task

Swipe to start coding

Use simple string tools โ€” methods, slicing, in, and f-strings โ€” to complete each expression. All variables are already defined โ€” do not change them.

Compute:

  1. name_clean โ€” remove extra spaces from full_name.
  2. has_quick โ€” check if "quick" appears in sentence (case-insensitive).
  3. inside_parens โ€” extract text between parentheses ( and ).
  4. o_count โ€” count how many 'o' letters are in sentence (case-insensitive).
  5. domain โ€” from email, take everything after @ (after trimming and lowercasing).
  6. report โ€” build "Name | Domain | Count" using an f-string and SEP.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 3. Chapterย 6
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

bookChallenge: Slicing and Search Drills

Swipe to show menu

Task

Swipe to start coding

Use simple string tools โ€” methods, slicing, in, and f-strings โ€” to complete each expression. All variables are already defined โ€” do not change them.

Compute:

  1. name_clean โ€” remove extra spaces from full_name.
  2. has_quick โ€” check if "quick" appears in sentence (case-insensitive).
  3. inside_parens โ€” extract text between parentheses ( and ).
  4. o_count โ€” count how many 'o' letters are in sentence (case-insensitive).
  5. domain โ€” from email, take everything after @ (after trimming and lowercasing).
  6. report โ€” build "Name | Domain | Count" using an f-string and SEP.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 3. Chapterย 6
single

single

some-alt