Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: String Slicing and Indexing | String Manipulation Essentials
Strings and Data Formats in Python
セクション 1.  4
single

single

bookChallenge: String Slicing and Indexing

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

Write a function that receives a string and a character, and returns the substring found between the first and last occurrence of the specified character in the string. If the character does not appear at least twice, return an empty string.

  • Find the index of the first occurrence of char in text.
  • Find the index of the last occurrence of char in text.
  • Extract and return the substring that lies strictly between these two indices.
  • Return an empty string if char does not appear at least twice in text.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt