You are viewing a single comment's thread. Return to all comments →
I got 6.9 for this in python 3:
for x in range(1,101): if x%3==0 and x%5==0:print("FizzBuzz") elif x%3==0:print("Fizz") elif x%5==0:print("Buzz") else:print(x)
Did i do good for someone that has been learning python for a week?
Edit:: Changed it up a little, now my score is 7.9::
for x in range(1,101): if x%15==0:print("FizzBuzz") elif x%3==0:print("Fizz") elif x%5==0:print("Buzz") else:print(x)
Edit:: EVEN BETTER! 9.6!
a="Fizz" b="Buzz" for x in range(1,101): print(a+b if x%15==0 else a if x%3==0 else b if x%5==0 else x)
9.7:
for x in range(1,101): print("FizzBuzz" if x%15==0 else "Fizz" if x%3==0 else "Buzz" if x%5==0 else x)
This'll probably be my last, 13.6::
for(x)in range(1,101):print("Fizz"*(x%3==0)+(x%5==0)*"Buzz"or x)
FizzBuzz
You are viewing a single comment's thread. Return to all comments →
I got 6.9 for this in python 3:
Did i do good for someone that has been learning python for a week?
Edit:: Changed it up a little, now my score is 7.9::
Edit:: EVEN BETTER! 9.6!
9.7:
This'll probably be my last, 13.6::