[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Are there any programmer bros here familiar with Python? I need
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.
The stories and information posted here are artistic works of fiction and falsehood.
Only a fool would take anything posted here as fact.
You are currently reading a thread in /b/ - Random

Thread replies: 74
Thread images: 2
File: image.jpg (15 KB, 648x227) Image search: [Google]
image.jpg
15 KB, 648x227
Are there any programmer bros here familiar with Python? I need help with BuzzFizz
>>
Yep, go ahead and ask. But first:
1. Are you in college?
2. If yes, where?
>>
Sss s s sss ss ss sss sss ss sss
Tl;dr: sssss
>>
>>669905759
Hey dude you still here? Not in college just studying for a course
>>
>>669907042
Yep still here what's the question
>>
>>669905415
Been at the degree for about 2 years, doing better than most of my classmates.
Can you give me specifics?
>>
>>669907234
>>669907627

K gimme a sec my bros gotta get the question out I'll show you what I've done
>>
>>669907627
>degree
>2 years
>spending shitloads of money for nothing

Why would you go to college to be a programmer? Are you autistic? I took online courses and got my first developer job in like six months. Four years later, instead of being in school and accruing debt I'm on a six figure salary with benefits
>>
>>669907974
Pretty much this. CS degrees are for the double digit IQ
>>
OP here, here's what I need to do. I need to pretty much make that buzz fizz shit, except I need to make it so that the users can input their own number and the buzz fizz will go up to that number..

Here's what I have so far, I've half done it and don't know what to do now. I don't even know how to define num yet

def getinput( ):
value=input('Enter positive integer: ')
if value.isnumeric():
return int(value)
else:
return 0

for buzzfizz in range (0,num+1):
if buzzfizz % 15 == 0:
print('BUZZFIZZ')
elif buzzfizz % 3 == 0:
print('BUZZ')
elif buzzfizz % 5 == 0:
print('FIZZ')
else:
print(buzzfizz)
>>
>>669907974
Depends on what kind of job you're trying to land. Though for this kind of field it's more about showing what you're able to do
>>
>>669908432
Oh, it was indented 4chan must have just unindented it
>>
>>669907974
My parents gave me a choice:
Either I'm out on the street or I go to college and they help pay.
I took the far better of the two options.
>>
>>669908432
Don't use is numeric, use is digit. Is numeric allows there to be floats
>>
haha, what the fuck, was actually watching this thread expecting something serious, well played :)
>>
>>669908592
Ooooooooooo I don't even know about isdigits hahaha I've only been taught this much.

What you mean by floats ? Fuck I'm hopeless lol
>>
>>669908432
Are you a retard or drunk?

>Select all the drinks

I'm guessing retard.
>>
>>669908432
This is some Preschool Python
>>
>>669908432
Okay don't use num, just put your other function in its place. Is this bait? Like what the fuck?
>>
>>669908814
Floating point numbers: a fancy word for fractional numbers.
>>
>>669908962
>>669908836
I only just started it last week and literally this is my 3rd time attempting it..

I've had no knowledge of programming before it :'(
>>
>>669908814
A float is a number with a decimal.
For example, 5 is an integer, but 5.001 is a float.
>>
>>669909035
Do you mean instead of num+1 I used getinput() instead bro? Please I'm new to this shit you guys are gods at programming
>>
>>669908432
n = int(raw_input())
for i in range(1, n+1):
if i % 15 == 0:
print "FIZZBUZZ"
elif i % 5 == 0:
print "FIZZ"
elif i % 3 == 0:
print "BUZZ"
>>
>>669909102
Python is a pretty easy language to learn, so don't sweat it.
With a little googling and some practice here and there, you catch on quick
>>
floating point is another word of IEEE 754 aswell :)
>>
>>669909102
Okay first, learn how to use google. Second don't use buzz fizz as the name for your iterative variable in your for loop, use the letter n for number. Third stop being retarded, fourth go fuck yourself if you seriously can't figure out how to make this work
>>
Seriously... There's so many fucking gay trap threads and dick rate threads here and amongst them you guys are actually quite fucking intelligent.

What are you guys doing on 4chan let alone /b/?
>>
>>669908432
If you're having trouble with getting a number from the user this will help.
http://www.tutorialspoint.com/python/python_files_io.htm
>>
>>669909345
Fuck n, i is the way to go!
>>
>>669909401
Go check out the fucking technology board. And believe it or not this place used to be the most intelligent place on the Internet.
>>
>>669909448
Fuck i! Use x!
>>
>>669909401

Im a computer sience student from Sweden, couldnt sleep so... why not b?
>>
people go to college to become engineers. no one needs a college degree for being a stupid code monkey developer.
>>
>>669906432
>my sides
>>
>>669909345
Fuck you.
Everyone had to start somewhere, why make fun of a beginner?
>>
>>669909541
This is coding not algebra, don't fucking use x
>>
>>669909401
Oh you dirty bitch, work the shaft!!
>>
>>669909321
Why is it raw_input not just input()?

>>669909325
>>669909345
>>669909327
I love you guys you really pull through in hard times for a program noob.

So should I replace word buzz fizz for x/i/n or whatever?
>>
>>669908814
>What you mean by floats ?

You can't be serious. Kill yourself.
>>
>>669905415
>can't even do FIzzBuzz
>>
>>669909594
I deal with people that can hardly code all day at work so im sorry but I can't handle this shit
>>
>>669909683
cuz it's python 2.x 2.7 to be exact. python 3.x+ uses input()
>>
>>669909632
for salt in post:
reply.append ('lol')

print (reply)
>>
>>669909683

first off, if you actually do not know what a float is, you should not be coding...

You should be learning about data types...
>>
>>669909683
Don't use x. N stands for number, I for integer, and e for element. If you're going to use a letter make sure it will mean something to anybody else that's going to read your code, it doesn't matter for small stuff like this but big projects will curb stomp you if you aren't naming shit properly
>>
>needing help with fucking fizzbuzz
>>
>>669909792
I can understand that.
I have this one friend that's gotten by in our classes just by using everyone else's work.
I had him for an application programming project, and the fucker literally never showed up once and still got full credit.
I understand your pain.
>>
>>669908432
1) return -1 instead of 0
2) delete the last else: print(buzzfizz)
3)add this line before for buzzfizz in range (0,num+1):
num = getinput()
>>
>>669909683
You can name a variable pretty much anything you'd like.
Try to conform to the PEP style guide which you can find on the Python website, so other people can read your code.
Readability is very important. If you look at your code tomorrow and it takes you a while to figure it out because you wanted to save a few bytes (of which you have millions to spare) then you were better off with your other name
>>
>>669909891
What better way to learn data types than to code? Every language handles data types differently so I'm sorry if you got some gay class at your pointless university about Java data types but it was a waste of time
>>
>>669909974
x is fine in loops where the scope ends on the same page. if you have a loop that spans 300 lines, that's just bad practice
>>
>>669910105

This girl i'm currently doing real-time systems with asked me to remove the main while loop and check if it helped...

She is great on like assembly though :P
>>
File: image.jpg (37 KB, 550x535) Image search: [Google]
image.jpg
37 KB, 550x535
>>669909768
I can bro but having to make it so that it lets you input your own number and integerating that to the bottom block is hard for me :'(

>>669909827
Ahh but I'm using 3.x bro

>>669909856
Well I know enough to atleast get this

>>669909891
I'm learning bro you guys are real helpful actually

>>669909974
You guys are more helpful than some of the helper teachers
>>
>>669905415


>>669909974, this, fucking this.
Whenever I'm going over a someone's code and he has no idea how to document what he wrote, I suddenly get vivid images of painting the walls with my brains.
>>
start solving Div2 As and Bs on www.codeforces.com and you'll be a master programmer in no time.
>>
>>669910224

Well, basic knowledge is still key... and define how every language uses data types differently?
>>
>>669907974
>tfw living in a country that won't call you for a job interview unless you have masters degree in CS
>tfw doing other kind of jobs because moving to USA would mean expensive but shit internet with caps and cops
>>
>>669910232
On what planet would you have a loop that spans 300 lines of code??? What in the absolute fuck makes you think it's okay to do that
>>
>>669910518
Have you ever seen college comp sci students code?
>>
>>669910284
Yeah, I haven't done much with assembly yet, still learning the basics.
But from what I've learned so far, it's an entirely different beast from any of the other languages I've learned.
>>
>>669910518
Not knowing how to use for loops will give you some long, long if statements with nests of additional if statements.
>>
>>669910518
And usually when people say "that's just bad practice", that means they don't think its okay to do that
>>
>>669910696
Fuck that, use labels and goto? :P

>>669910619
Actually, assembly is easy, its just fucking tedious!

Personally i favor C and C++
>>
>>669910696
i once generated C code for 100s of if else statements instead of using a for loop. freshman CS student.
>>
>>669910617
No wonder why you guys are absolute dog shit when you show up for work
>>
>>669910917
Are you fucking serious?!
>>
>>669910619
Well yes, it's one step up from binary. Unless you get a very niche position, you wont touch assembly in software engineering.
>>
OP here thank you so much bros!!! It works!!!

I love you all so much
>>
>>669910989
yeah i realised how stupid i was. i used the for loop in the generator program but not in the real code.
>>
>>669905415

>>>/g/sqt
>>
>>669910901
Or abuse the hell out of globals and not understand scope. Mix that with goto and you have some very !FUN! code
>>669910917
I never had that kind of dedication... I was like, "Fuck that. There has to be a way to not type that much" and procrastinated on the work by going off to read more.
>>
>>669910917
>42*48
>not using interrupts
>>
>>669911022
We learned a bit of both, we also made our own processors which we then programmed using assembly. luckily we didnt have to translate the assembly into binary manually for bigger assignments, but there was some...
Thread replies: 74
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.