The math function actually did b*c+a instead of a+b*c.. haha... Great tutorials though... I am learning python for a programming class and these tutorials are helping WAY more than my teacher is! Thanks Bucky!
probably it does not matter, but just in case: in tuna example you do multiplication first and than add and it gives you 26 (because (5+7)*3 does not equal 26) Otherwise very nice =)
for those confused that this 5+7*3=13*3=39 THAT IS WRONG!
Because you always first multiply or divide, then comes plus and minus. Unless it's in parantesis, like if it was (5+7)*3,then you first calculate whats in parantesis.
just going through this tutorial for the firs time myself. It appears python is using order of operation, PEMDAS, or whatever it's called. When calculating, it's actually doing 7*3, then adding 5 to that number, which equals 26
i had trouble with this one : the dictionary example wouldnt let me define the bacon - it complainedof a syntax error on the first colon inside the brackets ....
Bucky is intentionally making the functions (example, example2 in this video) extremely rudimentary for illustration purposes. He's using the function to simply print out the value(s) of the parameter(s) passed into it. Don't underestimate the power of functions in any programming language. They are VERY important. If you are starting to get confused, go back a couple of videos. Also, try things out yourself - It's the only true way to learn.
@ciba2227 I don't know if i explained it well enough. I hope it won't get any confusing. it's just like a loop, "inside" those paranthesis of example(). It loops the tuple named tuna like: example( for value in tuna: print value + ", " ) because the loop for tuna would print 5,7,3 this will print example(5,7,3)
thank you!
:DDDDDDDDDDDDDDD
Henrikko123 2 weeks ago in playlist Python Programming Tutorials
def example(this): print(this)
works the same way if you input a dic.
ihatetoedit 3 weeks ago
Hey why so much parameter stuff i dont see this being usefull is programming?
StarsHero8 2 months ago in playlist Python Programming Tutorials
need to know how to do this for python 3
ricardotheohfamous 2 months ago
@ricardotheohfamous The print statement changed to print(parameter_to_be_printed)
AceRimmer70 2 months ago
@ricardotheohfamous Everything is the same as in the video except the print function.
Instead of using "print this", you use "print(this)". Ignore the quotation marks.
SomeAnonymousDude 2 months ago in playlist Python Tutorial thenewboston
Need to know how to do this for python 3
its not working
ricardotheohfamous 2 months ago
@ricardotheohfamous I got Python 3.2 Its working all right
supersushi269 1 month ago
These tutorials make me hungry.
Tom64 2 months ago
@hazemboss a tube catcher ;)
71119david 3 months ago
@ Globox822
yes I forgot that thanx
beerymoustache 3 months ago
@hazemboss yes with jdownloader
artourky 4 months ago in playlist Python Programming Tutorials
If you were running Linux, when you made that semi-colon mistake, you would've been able to simply press up to recall your line XD
jmac217x 4 months ago in playlist Python Programming Tutorials
What you can also do is pass a complete list/tuple/dictionary onto your function. This can of course be done with multiple ones:
def example (a): print (a)
a=['ow','aw']
example(a)
belgisk 4 months ago in playlist Python Programming Tutorials
The math function actually did b*c+a instead of a+b*c.. haha... Great tutorials though... I am learning python for a programming class and these tutorials are helping WAY more than my teacher is! Thanks Bucky!
TheyCallMeBtoo 5 months ago
Comment removed
245konrax1 5 months ago
wait, cant you just type the dictionary name insted of making a new function??
i dont see why not....
noobjesss 5 months ago
Bucky you could make a great eBook for this!
Dragalug 5 months ago
dictionary made of bacon that is why I watch these
inuasha880 6 months ago 2
you can use any lika this, too:
def funkcia(a,b,c): print a + b + c
nums = ('a':5,'b':10,'c':8) # this is a dictionary u must change the () i cannot sent it on youtube
funkcia(**nums) #23
viliam22 7 months ago
tuna=(5,7,3)
SyntaxError: invalid syntax'
what the fuck??? i did exactly as he did on the video and got an error. grrrrr
killer2611 7 months ago in playlist Python Programming Tutorials
probably it does not matter, but just in case: in tuna example you do multiplication first and than add and it gives you 26 (because (5+7)*3 does not equal 26) Otherwise very nice =)
Artyom109Zinchenko 7 months ago
@Artyom109Zinchenko That's just how computers' do it, don't know why, they just do!
bace1000 6 months ago
@bace1000 =)
Artyom109Zinchenko 6 months ago
Comment removed
Artyom109Zinchenko 7 months ago
2 people thought this was a "Snake VS Bucky" video
remixxproduction 8 months ago
Nice trick.
FreelancePatriot76 8 months ago
2 people were eaten by a BIIIG PYTHON snake ;)
supersushi269 8 months ago
Earlier you said that you can't perform any operations with tuples, why does this work here, then?
srnmd 8 months ago
@srnmd you sure that' what he said?
I'm pretty sure he said that tuples could not be changed, but only called, which is what he does in this tutorial.
arngorf 7 months ago
5+7*3=26 lol exponents comes first 7*3+5=26 I know you knew that I'm just messing around :)
track4042010 8 months ago
Comment removed
DJAlltop 7 months ago
Precedence of multiplication and division is higher then add and subtract.
haseebahmadk 8 months ago
Well,l did 5+7*3,which it said it = 26,but 5+7 is 12...*3=36 not 26.?
Something's wrong with Python Shell.
CallofDuty123456and7 9 months ago in playlist Python Programming Tutorials
@CallofDuty123456and7 Sorry, but you got the math wrong :)
You need to multiply before you add, therefore: 7*3 = 21, +5 = 26.
This is because 7*3 + 5 actually means 7+7+7 + 5 or 3+3+3+3+3+3+3 + 5
shanshorshe 9 months ago
Comment removed
DJAlltop 7 months ago
great work dude
revanux 9 months ago
Very Good
paicychen 9 months ago
the best thing is just requesting for information, like: "raw_input("What's your name? ")"
SSweetAngel 11 months ago
my 6th grade math teacher was right, PEMDAS is useful for something
pianoman1928 1 year ago
@pianoman1928 what's PEMDAS?
SSweetAngel 11 months ago
@SSweetAngel
parenthesis, exponents, multyplication,division , adition , subtraction is the order of operation
loko95ftp 10 months ago
@loko95ftp Good to know about the "PEMDAS" shortcut, thanks ^_^
SSweetAngel 9 months ago
does anyone know of a command list anywhere???
TheMisterMan101 1 year ago
for those confused that this 5+7*3=13*3=39 THAT IS WRONG!
Because you always first multiply or divide, then comes plus and minus. Unless it's in parantesis, like if it was (5+7)*3,then you first calculate whats in parantesis.
So correct result is 5+7*3=5+21=26.
Globox822 1 year ago 11
@Globox822 Lol, I always use PEMDAS
Parenthesis, Exponents, Multiplication, Division, Addition, Subtraction
Of course, that was in 5th grade...
SuperCoolBuild 3 months ago
windows = 4
if windows == 4: print "Windows is whack, get Linux."
5thElementMods 1 year ago
its not working...
>>> def example2(**this): print this
>>> bacon=('mom':32, 'dad':54)
SyntaxError: invalid syntax
kadinz1 1 year ago
@kadinz1
XD
ROFLOFAO 1 year ago
@kadinz1
change >>> bacon=('mom':32, 'dad':54)
into >>> bacon={'mom':32, 'dad':54}
you just got mix up with the brackets
ROFLOFAO 1 year ago
what if tuna tuple has more elements? like (5,7,3,8,1,2)
even though there is a * before tuna, I get a warning that example takes only 3 arguments, but I have 6.
mag69gy 1 year ago
thumbs up if bucky has the best tutorials! (also sub him and me too)
2AWESOMETV 1 year ago
very interesting. I can really start to see how I might apply this to my app ideas.
adamsiddhi 1 year ago
so the dictionary bacon, esentually BECAME this for the function? not that complicated :/
hobbertin 1 year ago
5+7*3=26??!
Even with the order of operation respected that's wrong!
fullofhate77 1 year ago
@fullofhate77 Eh, how so? :p
7*3 = 21
21+5 = 26
Remember the MDAS rule! :D
mr1422 1 year ago
@fullofhate77 thank God, i was looking down here and i was starting to think i was the only one who got that, i wonder why that is though?
Vegeta101691 1 year ago
@Vegeta101691 *(times) comes before + or - , in this case the +(plus) operator, therefore:
7x3=21, 21+5 = 26 :)
Imagine there are brackets in your head, 5+(7x3)=26
(5+7)x3=36... (incorrect since there are NO brackets here, it's just 5+7*3, 7x3 comes before the +5).
SSweetAngel 11 months ago
@fullofhate77 Lol have you finished school?
7*3=21
21+5 = 26 xD
simme808 1 year ago
@fullofhate77
multiply overpowers add so 7 x 3 is 21 add 5 and you get 26 whats wrong about that??
dan1189 1 year ago
I like how the video stops just after 4:20
almackska 1 year ago
Thanks po
ffffgen 1 year ago
I have found all the tutorials to be very informative.
Thank you Bucky for taking the time to create them.
sandersona 1 year ago 2
can someone mention an example when you would use this, bit confused at the last 3 tuorials
briishspy 1 year ago
hello bucky!!!!! ur python tutorials are awesome man. hey! i'm waiting for ur tutorials on multithreading and socket programming :-)
rahulgrg71 1 year ago
sorry bucky, I can not hear clearly what you said from 4:00 to 4:09? ? could you reply me. I can't catch it!!
thank you very much for your video!
nutellatj 1 year ago
question, are you traumatized with meat, (bacon, beef, sausage, est...)?
anyways thks for the tuts, there awsome and help a lot!!
spartanxxxhybrid 1 year ago
sometimes getting an error is funnier then not getting it: def example2(**this):)
augustuen 2 years ago
Nice tutorial.
But the pronunciation is killing me... tuple = too-pull.
spike46042 2 years ago
12*3=36 right? Maybe I'm loosing it
AfterShockPivot 2 years ago
just going through this tutorial for the firs time myself. It appears python is using order of operation, PEMDAS, or whatever it's called. When calculating, it's actually doing 7*3, then adding 5 to that number, which equals 26
sirjibbylee 2 years ago
that's cool, auto ordering. I'm used to programing languages doing it in order.
AfterShockPivot 2 years ago
Comment removed
happymerc 2 years ago
Comment removed
vV1perXx 2 years ago
in order to get 36 u must write the code like this: (a+b) *3
Bucky's code goes like this:
7*3 +5 cause multiplication goes first in order.
Sorry for my bad english tho.
vV1perXx 2 years ago
it does the multiplication first. It has to do with the variable precedence. So 7*3 = 21 +5 == 26
lifeordeath3288 2 years ago
JESUS CHRIST I GET IT
AfterShockPivot 2 years ago 58
i had trouble with this one : the dictionary example wouldnt let me define the bacon - it complainedof a syntax error on the first colon inside the brackets ....
rapparoo 2 years ago
Comment removed
darcnis 2 years ago
Comment removed
pizza413 2 years ago
starting to get a little confusing
ciba2227 2 years ago 41
@ciba2227
Bucky is intentionally making the functions (example, example2 in this video) extremely rudimentary for illustration purposes. He's using the function to simply print out the value(s) of the parameter(s) passed into it. Don't underestimate the power of functions in any programming language. They are VERY important. If you are starting to get confused, go back a couple of videos. Also, try things out yourself - It's the only true way to learn.
Thanks Bucky, these are excellent.
thelctrclengnr 1 year ago
@ciba2227 lol yah, each video have less views :P
xXxDiukexXx 1 year ago
cakal00 1 year ago
@ciba2227 If you don't use the asterisk before the variable name (in this case tuna) then it would be something like
example((5,7,3), , ), The first parameter would be assigned the tuple itself and the other two parameters would be empty.
cakal00 1 year ago
Comment removed
ciba2227 2 years ago
If you got a tuple>>> (*tuple) can you just get one input like...in this example:
def example (whatever, *tuple)
then something like this>> ('hey',onetuple) ????
elteachel 2 years ago
This comment has received too many negative votes show
gfsdffs
xFireMan1x 2 years ago
hey dude thanks a lot im like in the 3th episode XDD keep em going!
nonglotter 2 years ago
This comment has received too many negative votes show
1st view first comment!
nuggetsman28 2 years ago