一行でFizzBuzz
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by devel on 2017/04/29. def main(): print(["FizzBuzz : {}".format(i) if i%15==0 else "Fizz : {}".format(i) if i%3==0 else 'Buzz : {}'.format(i) if i%5==0 else i for i in range(1, 100)]) if __name__ == '__main__': main()