Viewing a response to: @reggaemuffin/introducing-the-coding-challenge
My solution for python: ``` def fizzbuzz(n): multipleOf3 = n % 3 multipleOf5 = n % 5 if (multipleOf3 == 0 and multipleOf5 == 0): return "FizzBuzz" elif (multipleOf3 == 0): return "Fizz" elif (multipleOf5 == 0): return "Buzz" else: return n for n in range(101): print(fizzbuzz(n)) ```
author | eastmael |
---|---|
permlink | re-reggaemuffin-introducing-the-coding-challenge-20170817t163546110z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"app":"steemit/0.1"} |
created | 2017-08-17 16:35:21 |
last_update | 2017-08-17 16:35:21 |
depth | 1 |
children | 3 |
last_payout | 2017-08-24 16:35:21 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.275 HBD |
curator_payout_value | 0.091 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 318 |
author_reputation | 78,967,407,130,763 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,100,357 |
net_rshares | 105,617,815,737 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
reggaemuffin | 0 | 105,617,815,737 | 1% |
One suggestion I would have is keep the return type of fizzbuzz consistent. So I would probably do a `return str(n)` to ensure it is always a string. And in python I would follow snake_case with my variables so `multiple_of_3` would be the preferred format. Your solution looks good and I think it it correct, well done :)
author | reggaemuffin |
---|---|
permlink | re-eastmael-re-reggaemuffin-introducing-the-coding-challenge-20170817t173004188z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"app":"steemit/0.1"} |
created | 2017-08-17 17:30:06 |
last_update | 2017-08-17 17:53:09 |
depth | 2 |
children | 2 |
last_payout | 2017-08-24 17:30:06 |
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 | 323 |
author_reputation | 37,964,839,695,531 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,104,541 |
net_rshares | 0 |
Thank you for the feedback. I'm come from Java. Automatically coded in it's coding style. lols
author | eastmael |
---|---|
permlink | re-reggaemuffin-re-eastmael-re-reggaemuffin-introducing-the-coding-challenge-20170818t170513133z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"app":"steemit/0.1"} |
created | 2017-08-18 17:04:45 |
last_update | 2017-08-18 17:04:45 |
depth | 3 |
children | 0 |
last_payout | 2017-08-25 17:04:45 |
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 | 94 |
author_reputation | 78,967,407,130,763 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,191,805 |
net_rshares | 0 |
lol, snake case for python. I get it! =D I kinda wonder about these traditions of code styles and methods. It would be cool to tell a story about the history of traditions like "hello world" and such.
author | philosophist |
---|---|
permlink | re-reggaemuffin-re-eastmael-re-reggaemuffin-introducing-the-coding-challenge-20170818t061116915z |
category | coding-challenge |
json_metadata | {"tags":["coding-challenge"],"app":"steemit/0.1"} |
created | 2017-08-18 06:11:15 |
last_update | 2017-08-18 06:11:15 |
depth | 3 |
children | 0 |
last_payout | 2017-08-25 06:11:15 |
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 | 201 |
author_reputation | 1,642,759,591,030 |
root_title | "Introducing the Coding Challenge" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 12,149,363 |
net_rshares | 0 |