Cont. of >>71345981

Cont. of I've been learning Python on and off for about 6 months now and Linux for 2 months. I'm pretty good automating things on my vps in Python scripts. Here's an example of my attempt to solve fizzbuzz:

for i in range(1,100):
x = i / 15
if x == int(x):
print ("fizzbuzz")
else:
x = i / 5
if x == int(x):
print ("fizz")
else:
x = i / 3
if x == int(x):
print("buzz")
else:
print(i)


How do I get a job now?

Attached: 298E2E44-276D-4216-864B-571DE0AC9053.png (815x476, 31K)

that only goes till 99. you failed already.

That's just a technicality, not a code problem. I would imagine that I'm above at least 50% of people who get hired simply with my code alone.

Don't call us, we'll call you.
Security will escort you out.

Im serious. It literally took me 5 seconds to come up with that fizzbuzz solution and 1 minute to write it. I've seen the other solutions before, when I was watching YouTube videos but haven't looked at it in a while.

I'm not trying to brag but surely it can't be that bad that no one would hire me?

Cunt fuck off. This isn't your blog why the fuck aren't mods banning this garbage.

im sure your trolling but you will never get questions this easy in an interview. if you want examples filter leetcode by medium/hard to get an idea of the type of questions they'll be asking you.

...serious question! how much codelines you wrote in this time period? just asking because in the same situation but different project.

Attached: 1411248860004.jpg (500x335, 19K)

how do i learn linux, pls tell me

Probably a couple of thousand. You?

Thanks, I'll check out leetcode. And I'll check out leetcode.

your not ready kid

I would have thought x = i/15 would be an integer, thus x == int(x) would always be true? Does this code work?

... around 10k, current project code is ~4k

Attached: 1311859747928.jpg (392x273, 20K)

try:
[print("fizz" * (not i%3) + "buzz" * (not i%5) or i) for i in range(1,101)]

OP, I thought we sufficiently told you to fuck off in the last thread. Your fizzbuzz is just godawful.

I mean, I'm just a hobbyist, but three nested if statements seem rather messy for a simple fizzbuzz. Also what's the benefit of using the int check over modulos (provided you don't use an integer division, like already pointed out, and your fizzbuzz actually works)?

are you even trying

for i in range(1,101):print("FizzBuzz"[i*i%3*4:8--i**4%5] or i)

>nested if statements
Is there something wrong with that?

Attached: 1539121089708.jpg (625x541, 51K)

It looks like you puked spaghetti on the screen

for i in range(1, 101):
if x % 15 == 0:
print("fizzbuzz")
elif i % 5 == 0:
print("buzz")
elif i % 3 == 0:
print("fizz")
else:
print(i)

It works, but it's rather confusing. Python offers elif for a reason.

Can you do it my way using elif?

Your way is absolutely retarded, but here you go

for i in range(1, 101):
if x / 15 == int(x):
print("fizzbuzz")
elif x / 3 == int(x):
print("fizz")
elif x / 5 == int(x):
print("buzz")
else:
print(i)

Ah yes I see. Thanks.

Replace x with i but yeah

This is the most perfect version of FizzBuzz.

this is the only acceptable solution

Here a version that actually works.
for i in range(1, 101):
if i/15. == int(i/15.):
print("fizzbuzz")
elif i/5. == int(i/5.):
print("buzz")
elif i/3. == int(i/3.):
print("fizz")
else:
print(i)

> x = i / 15
if x == int(x):
what the fuck

Python 3 doesn't truncate integer division any more, get with the times grandpa.

>"Look at my answer to a standardised programming test"
>Your answer is flawed
>"Yeah I knew that, I could have got it right if I wanted to"

Jesus Christ you must have employers lining up to hire you

Just read the previous thread, if you want to get a glimpse of how OP thinks of himself. He actually believed that some script that read files and queried a database for usernames contained in the file was some enormous feat he had accomplished.

My bad. I forgot that I changed my default Python version from 3.6 to 2.7 at some point in the past.

I don't know python, only js (I'm a beginner). Isn't the X undefined in this one? Should that say i also?

Yes

Where's your fizzbuzz, genius?

Here and here , although you should replace i with x or vice versa.

I also posted in the previous thread

Ok, you get a pass for now. Otherwise you were on the verge of a verbal lashing.

the state of Jow Forums