Added: 2 years ago
From: thenewboston
Views: 34,522
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (94)

Sign In or Sign Up now to post a comment!
  • thank you!

    :DDDDDDDDDDDDDDD

  • def example(this):  print(this)

    works the same way if you input a dic.

  • Hey why so much parameter stuff i dont see this being usefull is programming?

  • need to know how to do this for python 3

  • @ricardotheohfamous The print statement changed to print(parameter_to_be_printed)­

  • @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.

  • Need to know how to do this for python 3

    its not working

  • @ricardotheohfamous I got Python 3.2 Its working all right

  • These tutorials make me hungry.

  • @hazemboss a tube catcher ;)

  • @ Globox822

    yes I forgot that thanx

  • @hazemboss yes with jdownloader

  • 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

  • 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)

  • 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!

  • Comment removed

  • wait, cant you just type the dictionary name insted of making a new function??

    i dont see why not....

  • Bucky you could make a great eBook for this!

  • dictionary made of bacon that is why I watch these

  • 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

  • tuna=(5,7,3)

    SyntaxError: invalid syntax'

    what the fuck??? i did exactly as he did on the video and got an error. grrrrr

  • 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 That's just how computers' do it, don't know why, they just do!

  • @bace1000 =)

  • Comment removed

  • 2 people thought this was a "Snake VS Bucky" video

  • Nice trick.

  • 2 people were eaten by a BIIIG PYTHON snake ;)

  • Earlier you said that you can't perform any operations with tuples, why does this work here, then?

  • @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.

  • 5+7*3=26 lol exponents comes first 7*3+5=26 I know you knew that I'm just messing around :)

  • Comment removed

  • Precedence of multiplication and division is higher then add and subtract.

  • 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 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

  • Comment removed

  • great work dude 

  • Very Good

  • the best thing is just requesting for information, like: "raw_input("What's your name? ")"

  • my 6th grade math teacher was right, PEMDAS is useful for something

  • @pianoman1928 what's PEMDAS?

  • @SSweetAngel

    parenthesis, exponents, multyplication,division , adition , subtraction is the order of operation

  • @loko95ftp Good to know about the "PEMDAS" shortcut, thanks ^_^

  • does anyone know of a command list anywhere???

  • 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 Lol, I always use PEMDAS

    Parenthesis, Exponents, Multiplication, Division, Addition, Subtraction

    Of course, that was in 5th grade...

  • windows = 4

    if windows == 4:  print "Windows is whack, get Linux."

  • its not working...

    >>> def example2(**this): print this

    >>> bacon=('mom':32, 'dad':54)

    SyntaxError: invalid syntax

  • @kadinz1

    XD

  • @kadinz1

    change >>> bacon=('mom':32, 'dad':54)

    into >>> bacon={'mom':32, 'dad':54}

    you just got mix up with the brackets

  • 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.

  • thumbs up if bucky has the best tutorials! (also sub him and me too)

  • very interesting. I can really start to see how I might apply this to my app ideas.

  • so the dictionary bacon, esentually BECAME this for the function? not that complicated :/

  • 5+7*3=26??!

    Even with the order of operation respected that's wrong!

  • @fullofhate77 Eh, how so? :p

    7*3 = 21

    21+5 = 26

    Remember the MDAS rule! :D

  • @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 *(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).

  • @fullofhate77 Lol have you finished school?

    7*3=21

    21+5 = 26 xD

  • @fullofhate77

    multiply overpowers add so 7 x 3 is 21 add 5 and you get 26 whats wrong about that??

  • I like how the video stops just after 4:20

  • Thanks po

  • I have found all the tutorials to be very informative.

    Thank you Bucky for taking the time to create them.

  • can someone mention an example when you would use this, bit confused at the last 3 tuorials

  • hello bucky!!!!! ur python tutorials are awesome man. hey! i'm waiting for ur tutorials on multithreading and socket programming :-)

  • 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!

  • question, are you traumatized with meat, (bacon, beef, sausage, est...)?

    anyways thks for the tuts, there awsome and help a lot!!

  • sometimes getting an error is funnier then not getting it: def example2(**this):)

  • Nice tutorial.

    But the pronunciation is killing me... tuple = too-pull.

  • 12*3=36 right? Maybe I'm loosing it

  • 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

  • that's cool, auto ordering. I'm used to programing languages doing it in order.

  • Comment removed

  • Comment removed

  • 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.

  • it does the multiplication first. It has to do with the variable precedence. So 7*3 = 21 +5 == 26

  • JESUS CHRIST I GET IT

  • 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 ....

  • Comment removed

  • Comment removed

  • starting to get a little confusing

  • @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.

  • @ciba2227 lol yah, each video have less views :P

  • @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)
  • @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.

  • Comment removed

  • 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) ????

  • hey dude thanks a lot im like in the 3th episode XDD keep em going!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more