![]() |
|
Challenge - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Python (https://sinister.ly/Forum-Python) +--- Thread: Challenge (/Thread-Challenge--100155) Pages:
1
2
|
Challenge - casperandersen - 10-05-2018 Hey there guys and gals. So i would just like to propose a challenge for you guys. I want to challenge you to make a FizzBuzz program. This will not be a contest, so no prize. But try to make a program that prints all the numbers from 1 to 100 with the following exceptions: 1. for every number divisible by 3, you Write Fizz 2. for every number divisible by 5 you write Buzz 3. and for every number divisible by 3 AND 5 you write FIzzBuzz Good luck, and have fun feel free to post here if you are stuck xDps. to challenge you all further, try to make it as small as possible RE: Challenge - casperandersen - 10-05-2018 also, please post your code here when you are done
RE: Challenge - Jimbo39238 - 10-05-2018 I remember doing this a long time ago in JavaScript. Simple and a good way to test your skills as a beginner
RE: Challenge - casperandersen - 10-06-2018 (10-05-2018, 11:01 PM)Jimbo39238 Wrote: I remember doing this a long time ago in JavaScript. Simple and a good way to test your skills as a beginner why dont you give it a shot? xD RE: Challenge - Vanfuzzy - 10-06-2018 tbh I have no experience in coding but good job with this post
RE: Challenge - casperandersen - 10-06-2018 thanks give it a shot anyways
RE: Challenge - slothic - 11-01-2018 Code: a = 1
for i in range(100):
if (a % 3) + (a % 5) == 0:
print("Number:",a," FIzzBuzz")
if (a % 3) == 0:
print("Number:",a,"Fizz")
elif (a % 5) == 0:
print("Number:",a,"Buzz")
else:
print(a)
a += 1
RE: Challenge - casperandersen - 11-02-2018 (11-01-2018, 09:40 PM)slothic Wrote:nice one. How do you like this? Code: print '\n'.join("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i) for i in range(1,101))
RE: Challenge - slothic - 11-02-2018 (11-02-2018, 03:46 PM)oxnan Wrote:(11-01-2018, 09:40 PM)slothic Wrote:nice one. How do you like this? Damn, I've never tried doing anything in one line. Looks good. RE: Challenge - chunky - 11-07-2018 (11-02-2018, 03:46 PM)oxnan Wrote: nice one. How do you like this?Kinda weird you came up with a solution that already has been public in 2013 http://michaeljgilliland.blogspot.com/2013/01/one-line-fizz-buzz-test-in-python.html |