Viewing a response to: @reggaemuffin/introducing-the-coding-challenge
Here is my Python submission. Not the prettiest, but it works. def FizzBuzz(n): fizz = False buzz = False r = 0 if type(n) != int: r = type(n) elif n==0: r=0 else: if n%3== 0: fizz = True if n%5 ==0: buzz = True if fizz & buzz: r = 'FizzBuzz' elif fizz: r = 'Fizz' elif buzz: r = 'Buzz' else: r = n print(r) return r for i in range(0,101): FizzBuzz(i) The spacing got messed up. So to run it, it will need some fixing.
author | n4t3w |
---|---|
permlink | re-reggaemuffin-introducing-the-coding-challenge-20170820t162023033z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"app":"steemit/0.1"} |
created | 2017-08-20 16:20:30 |
last_update | 2017-08-20 16:20:30 |
depth | 1 |
children | 0 |
last_payout | 2017-08-27 16:20:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 468 |
author_reputation | 49,667,465,108 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,359,988 |
net_rshares | 0 |