Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Haaste: Viipalointi- ja Hakuharjoitukset | Merkkijonot
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Tietotyypit Pythonissa

bookHaaste: Viipalointi- ja Hakuharjoitukset

Tehtävä

Swipe to start coding

Use simple string tools — methods, slicing, in, and f-strings — to complete each expression. All variables are already defineddo 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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 6
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookHaaste: Viipalointi- ja Hakuharjoitukset

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

Use simple string tools — methods, slicing, in, and f-strings — to complete each expression. All variables are already defineddo 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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 6
single

single

some-alt