Skip to content

Pythonワンラインチャレンジ FizzBuzz問題

Notifications You must be signed in to change notification settings

momerio/oneline_fizzbuzz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

oneline_fizzbuzz

Pythonワンラインチャレンジ FizzBuzz問題

<FizzBuzz ルール>

  1. 3で割り切れる→Fizz
  2. 5で割り切れる→Buzz
  3. 3かつ5で割り切れる→FizzBuzz
  4. 上記すべて以外→数字を出力

→ 答えは "Fizz Buzz FizzBuzz 2" と出力される.

[print(n) for n in [3, 5, 15, 2] if not (n % 3 == 0 and n % 5 == 0) or print("FizzBuzz") if not (n % 3 == 0) or print("Fizz") if not (n % 5 == 0) or print("Buzz")]

About

Pythonワンラインチャレンジ FizzBuzz問題

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages