0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「特定の文字が”1つのみ”含まれる」の表現方法

Posted at

思考プロセス

カウント関数を用いて、対象の文字列に含まれる文字の数を取得し、1であれば「1つのみ」を表現できる。

s = "hello@world.com"
print(s.count("@") == 1)  # True
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?