I'm not a programmer but I've been watching some tutorials and can code some things in python that do various things like delete x amount of files in y directory. Or unzip this file until reached x amount then run some training code.
I never took programming seriously but I was looking at some YouTube videos and this fizzbuzz question came up. Do people actually have trouble solving fizzbuzz?
Is fizzbuzz an inside joke or something in the programming community or can I actually apply for a programming job being able to solve it? I only know python and some basic postgresql.
its a very easy question passing it doesnt mean you can get a job
Anthony Mitchell
The joke comes from people who swindled their way into large corporations as 'senior developer' by simply stapling together libraries for SalesForce or whatever, then they get laid off or exposed so they try and get another job as library stapler then can't solve fizz buzz.
So the answer is no you probably will not be able to get a job with zero portfolio, open source pull req history or any knowledge beyond fizzbuzz unless your cousin is hiring for Oracle or something.
Austin Cooper
So you're saying I need to have a github account, create some unique project and then put it on my resume and I'll have a chance at getting hired?
Even with a biology degree and not a C.S. degree?
Austin Nguyen
>Even with a biology degree If is different, if you have a different degree. Then, you should be ok to just be able to explain, why this is exceptional & good for the job you aim to get, as the people at the interview most likely do not have a clue how to read a single line of code. They would not even be able to understand what actually is within your portfolio, if you dont explain it to the most basic level.
I work as a business intelligence analyst and code basic stuff in VBA, python and SQL. My bosses and the people who hired me go crazy over this, yet would not be able to produce a "hello world" in VBA, if their life would depend on it.
Jace Martinez
>hey guys, I only know how to do fizzbuzz >will that get me a programming job?
That's what you sound like
Benjamin Campbell
My impression was that FizzBuzz is a screening question for weeding out retards
Sebastian Sanders
I'm just wondering how much knowledge I need to apply for a programming job. What type of work do you do for python if you get a job involving python.
Can't I just look up most of the things if I don't really understand it yet 100%?
And I was asking if fizzbuzz was some kind of an inside joke or not.
Camden Rivera
Bruh are you autistic or does the dunning kruger effect manifest strongly in you? You should be well aware of the reason why some people are having problems with it, not everybody has a brain programmed to do math
Kayden Ross
I'm wondering if fizzbuzz has any relation to actual programming or is it a meme question that is an inside joke. You don't have to be good at math to solve fizzbuzz that's fucking simple multiplication.
FizzBuzz is a way to determine whether you can structure a program to take preconfigured output and produce expected output. It's not to determine your skill level, it's to determine whether it's worth determining your skill level.
A lot of companies are willing to hire entry-level programmers to train to work within their ecosystem, but they won't hire someone that hasn't taken a basic course in programming, or taken the time to learn the basics themselves.
Xavier Myers
Being able to add 1 to a number is enough to do 99% of what programming is about, and even that is not necessary anymore since maps became popular outside of fp languages. You could be a competent programmer knowing literally nothing but arithmetics.
David Bailey
I did some test programming questions from this website, this one was listed as "easy".
>Have the function LetterChanges(str) take the str parameter being passed and modify it using the following algorithm. Replace every letter in the string with the letter following it in the alphabet (ie. c becomes d, z becomes a). Then capitalize every vowel in this new string (a, e, i, o, u) and finally return this modified string.
Is my pic related a poor solution to this problem?
Err now that i'm looking at it i think i put if y = "z" in the wrong place...
Ian Reyes
The point is that for some God forsaken reason 90% of programmers can't do it. It's the easiest of easy questions. Less than a small problem or even a tiny problem. It's minuscule. And yet most applicants will fuck it up, overcomplicate it, or show that they have no idea how to organize and write maintainable code. Often some Frankenstein abomination of the three. The point of fizzbuzz is to not waste the interviewer's time with a candidate that literally cannot write code at all. blog.codinghorror.com/why-cant-programmers-program/
Evan Foster
LOL
Easton Rivera
Damn, are you implying by that that I have no future in programming?
Brandon Nelson
you fucked up the algorithm, it's not doing exactly what the spec says
sorry I misread your code, the if y = z then make it a won't work, you should consider why
Gavin Flores
I never heard of fizz buzz before this thread. This is what I came up with: def fizzbuzz(n): x=""; for i in range(n+1): x="\t"+str(i)+"\t"; if i%3==0: x = x + "fizz "; if i%5==0: x = x + "buzz"; print(x);
It's probably shit since I don't write code.
Caleb Russell
This is still wrong. If you are trying to show off then at least read the specification properly.
Sadly I don't pay attention to your homework as much as you do. Change whatever is in vowels to the letters before a vowel instead of the vowel then, same thing
Carson Torres
What's wrong with that one?
Nathan Cox
Naw, it's cool: if the number is both divisible by 3 and 5, it adds both "fizz " and "buzz" to x. Here's the results.
function letterChanges(str) { let result = [], c, i = 0; while ((c = str.charCodeAt(i++)) >= 0) { switch (c) { case 122: case 90: c -= 25; break; default: ++c; break; } switch (c) { case 97: case 101: case 105: case 111: case 117: c -= 32; } result.push(c); } return String.fromCharCode.apply(null, result); }
Thomas Adams
actually that does work it's just a little strange how you use the y variable in some cases you would assign something to y but not use it because str[i] is Z
Austin Gray
Correction: "use strict";
function letterChanges(str) { let result = [], c, i = 0; while ((c = str.charCodeAt(i++)) >= 0) { if ( 64 < c && c < 91 || 96 < c && c < 123 ) { switch (c) { case 122: case 90: c -= 25; break; default: ++c; break; } switch (c) { case 97: case 101: case 105: case 111: case 117: c -= 32; } } result.push(c); } return String.fromCharCode.apply(null, result); }
Hunter King
True. I glanced over it.
Xavier Morales
I like the simplicity buy is 0 supposed to be a fizz buzz?
function fizzBuzz(start = 1, limit = 100) { const result = []; for (let i = start; i
Luis Perry
Dunno. Zero's a number, but it's easy to omit it since you just have to specify where the range starts in your for loop.
Yeah, I'm nowhere near that good.
Ian Wilson
You can't divide by zero.
Owen Sanders
If you have a biology degree you should look into biology related programming, e.g. protein folding problems, computational genomics, computational pharmacology - there are thousands of applications nowadays. Specialists with relevant education and some coding skills are vastly preferred over pure codemonkeys in these interdisciplinary areas, as it's much easier to teach the former to code than to impart all the field specifics onto latter. That being said, you should of course learn more than just Python and SQL, although it's a good start.
Yes, but you can divide 0 by 3 or 5. Zero can't be the divisor or the modulo.
Justin Gonzalez
Yeah but is the solution elegant or brute. I don't know shit.
So what else should I learn? Python is the easiest for me to read.
Jonathan Gomez
I have no idea of exact tools and I suspect it's highly dependent on particular research type. Go to your uni and ask around among faculty members and postgrads to get the picture. I'd say you should invest time into reading SICP thoroughly in any case.
Hudson Gonzalez
It's one step away from elegance. It demonstrates you know how to think about a problem. I would have done it like this
if str[i].isalpha(): if str[i] == "z" or str[i] == "Z": newstring += "A" else y = str[i]+1 if y == "a" or y == "e" or y == "i" or y == "o" or y == "u': newstring += y.captialize() else: newstring += y else: newstring += str[i] to avoid the uneccessary variable assignment
Nicholas Hall
Yeah that is a better solution. Thanks.
Thomas Turner
for my $i (1..1000) { if ($i%3 == 0 && $i%5 == 0){ printf "$i\tFizzBuzz\n"; next;} if ($i%3 == 0){ printf "$i\tFizz\n"; next;} if ($i%5 == 0){ printf "$i\tBuzz\n"; next;} }
Literally 5 minutes in Perl, and I'm not even an IT person. The last shit I did was some BASIC back in the early 2000's.
How the FUCK are there incompetents who can't do basic maths still in this field?
Cameron Harris
Wont that print fizzbuzz and fizz or buzz a second time?
If i%3 == 0 and i%%5 == 0: Print ("fizzbuzz") Else: If i%3==0: Print fizz If i%5==0: Print buzz
Joseph Turner
for i in range(100): if i%3 == 0 and i%5 ==0: print ("fizzbuzz") else: if i%3 ==0: print ("fizz") if i%5 == 0: print ("buzz")
1) Range(len(foo)) - use enumerate(foo) instead. More readable and saves your ass from indexing your shit wrong somewhere.
2) Rename the parameter. 'str' shadows a built-in name.
3) "y in 'aeiyou'" or "y in {'a','e','i','y','o','u'}" would accomplish the same thing and be easier to work with. Want to make it case-insensitive? Right now, you'd have to write 'or y.lower() == somecrap' five times.
4) This is probably waaaays off from being a concern, but gluing strings piecemeal like that is inefficient as fuck; in cases like that it's better to make the newstring a list then use str.join to build the actual output once you're done appending stuff to it.
Bentley Rodriguez
this board continues to amaze me, the hubris of programmers will forever be one of the wonders of the world.
I tried my hand at it, but I don't know how good it is: lamo Jow Forums is blocking my code snippet
Where do you find these exercises? My biggest problem learning coding was never having any exercises to practice on. The best I could find was some Arduino projects.
No man, it doesn't work that way. Just do something you like, you'll know sooner or later if you like it or not. It's not about getting a job or not, if you're thinking like that, you're gonna have a very bad time.
If you really like it, you'll notice it:
Each time: 1) you discover a new possibility. 2) you fix a problem. 3) you created and finished a project.
You feel a rush and feel like a god. You get the feeling you have so much power nobody can say shit to you. It's basically like cocaine.
If you don't experience this, it just means you're not smart enough, and it's ok, we're not all made equal and you should know your place brainlet.
Isaac Rogers
python jobs are mainly web backend programming, you are not going to do desktop programs with python
Lincoln Flores
Is my code.
It feel good to solve something but I'm wondering if I have a future in this or am I a long way off from doing anything remotely useful.
I have a project in mind so I guess I'll keep coding until i finish that.
Eli Phillips
If you're already hyped on this, you'll probably get even more hyped when you start developing a game or a project with a database or network shizzle.
It's about the rush man. The feeling of creating something that's never made before. Automating stuff you never knew was possible.
Stuff that's been done a million times don't give you that rush. Making something new gives that rush.
Evan Hughes
>lamo Jow Forums is blocking my code Could be noScript's XSS settings.
Tyler Anderson
Might be. Trying the original post form instead of 4chanX told me that my IP range was blocked, so I gave up. A function I wrote that reads drivers licenses to determine drinking age also causes the same problem, so I'm guessing there's something that pisses off some security feature. Guess I'll have to keep writing code to get a better estimate of what's causing it.
Ayden Nguyen
It blocked mine too. Said connection error.
Samuel Ortiz
If it's 4chanX, they blame it on CloudFlare. My first guess is it doesn't like the amount of arithmetic or it's too long. Short snippets like :(){ :|:& };: seem to work.
Landon Jones
Give us noobs some things to watch or read that are not introductory courses.
Is Structure and Interpretation of Computer Programs the next step?
Samuel Gonzalez
I'm a complete beginner, how can I solve the problem more efficiently ? Just tried something quick : n = int(input(" ")) i = 0 while(i
Aaron Allen
>Atom
Chase Morgan
You learn about optimizing later when you're advanced.
Daniel Sullivan
I'm a beginner too, what language are you learning and what are you watching and reading?
Ayden Sanchez
Okay, thanks I'll keep that for later C and Python, Pratical C programming - O reilly, The C programming Language, Ritchie Kernighan, And other sources but in french
Jose Stewart
I've seen it used to weed out liars. India has a work culture of claiming to be an expert on everything because they're manager told them to say that. One trick is to just change the words Fizz and Buzz to something else like Alpha and Beta so they have a harder time to google it if it's over the phone. One guy we gave that question to went silent for 5 minutes before finally starting to code. Then after another 5 minutes he came up with something like this. i = 0 while (i
Ryder Reed
Isn't it supposed to print every number between 1 and 100 and not just the ones divisible by 3 or 5?
Owen Adams
My original code will print the numbers that won't fizz or buzz. This thread rekindled my interest in scripting and the results I posted was me fooling around with logical operators.
Zachary Lewis
That works doesn't it?
Colton Cox
>Aside from the 'i' part, it is the right answer He literally printed the letter 'i' instead of the value of i. Also see the other red flags that made us not take him.
Connor Johnson
Mostly. It looks like it only prints the number if it's not a multiple of 3 or 5.
Leo Flores
Wow C is so much faster than Python : ~ 1.5s for 1 000 000, while python takes nearly 6s for 1000 -> FizzBuzz : 66 Fizz : 267 Buzz : 134 FizzBuzz+Fizz+Buzz : 467 5.780718564987183 s elapsed
Ah I thought print 'I' was a typo and supposed to be (i)
Gabriel Morris
What, how did you even manage that? $ time python ttest.py > /dev/null && time python ttest.pyc > /dev/null && time ./main.exe > /dev/null;
real 0m0.605s user 0m0.530s sys 0m0.061s
real 0m0.557s user 0m0.546s sys 0m0.015s
real 0m0.227s user 0m0.218s sys 0m0.000s
Even compiling python again doesn't make it take that long.
Lucas Baker
I wanna learn C, but it's mostly to write AVR code.
Leo Wright
Is that for 1000 iterations?
Christian Allen
1000000 iterations #!/bin/python for i in xrange(1000000): if i % 3 == 0: if (i % 5 == 0): print 'FizzBuzz' else: print 'Fizz' elif (i % 5 == 0): print 'Buzz' else: print i
#include
int main() { for (int i = 0; i < 1000000; i++) { if (i % 3 == 0) { printf("Fizz"); if (i % 5 == 0) printf("Buzz"); putchar('\n'); } else if (i % 5 == 0) { printf("Buzz\n", i); } else printf("%u\n", i); }
return 0; }
Anthony Garcia
What books would you guys recommend for beginners?
Asher Clark
for i in range(101): if i % 3 == 0 and i % 5 == 0: print("niggerlover") elif i % 3 == 0: print("nigger") elif i % 5 == 0: print("lover") else: print(i)
Josiah Rivera
Unironically mine is the best 0-100 fizzbuzz since I stole print(i)