create account

RE: Introducing the Coding Challenge by eastmael

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @reggaemuffin/introducing-the-coding-challenge

· @eastmael ·
$0.37
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))
```
👍  
properties (23)
authoreastmael
permlinkre-reggaemuffin-introducing-the-coding-challenge-20170817t163546110z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-17 16:35:21
last_update2017-08-17 16:35:21
depth1
children3
last_payout2017-08-24 16:35:21
cashout_time1969-12-31 23:59:59
total_payout_value0.275 HBD
curator_payout_value0.091 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length318
author_reputation78,967,407,130,763
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,100,357
net_rshares105,617,815,737
author_curate_reward""
vote details (1)
@reggaemuffin · (edited)
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 :)
properties (22)
authorreggaemuffin
permlinkre-eastmael-re-reggaemuffin-introducing-the-coding-challenge-20170817t173004188z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-17 17:30:06
last_update2017-08-17 17:53:09
depth2
children2
last_payout2017-08-24 17:30:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length323
author_reputation37,964,839,695,531
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,104,541
net_rshares0
@eastmael ·
Thank you for the feedback. I'm come from Java. Automatically coded in it's coding style. lols
properties (22)
authoreastmael
permlinkre-reggaemuffin-re-eastmael-re-reggaemuffin-introducing-the-coding-challenge-20170818t170513133z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-18 17:04:45
last_update2017-08-18 17:04:45
depth3
children0
last_payout2017-08-25 17:04:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length94
author_reputation78,967,407,130,763
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,191,805
net_rshares0
@philosophist ·
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.
properties (22)
authorphilosophist
permlinkre-reggaemuffin-re-eastmael-re-reggaemuffin-introducing-the-coding-challenge-20170818t061116915z
categorycoding-challenge
json_metadata{"tags":["coding-challenge"],"app":"steemit/0.1"}
created2017-08-18 06:11:15
last_update2017-08-18 06:11:15
depth3
children0
last_payout2017-08-25 06:11:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length201
author_reputation1,642,759,591,030
root_title"Introducing the Coding Challenge"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id12,149,363
net_rshares0