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

Link to this comment:

Share to:

All Comments (146)

Sign In or Sign Up now to post a comment!
  • Thats more like a GILF

  • "in" is preferred over has_key() since Python 2.3

  • I have been following bucky's video for a while now, now i just have a question.

    how is the shell related to the actually program?

    I know shell can help us to figure out things, but how can the stuff we learn on shell put on the program.

    example like this tutorial about dictionary

    please help :)

  • Or maybe use it like a variable bank (name, str, hp, etc.) Do the numbers work like ints or are they strings? Can you convert them? Sure there are other ways to store variables in similiar ways but it would be cool, clean way I guess.

  • I can see how this could be very usefull for things like storing info for examing item like in Runescape (examine rock -> this is a rock).

  • WOW

    

  • um how would you get the Dad and the Mom bit so it would be bob and lisa like a cipher basically

  • In python 3 its print(book["Dad"])

  • does he know what a milf is?

  • So can you not do this with Sequences? I mean the only difference is like ':'

  • Seriously... Thank you so much for all of this. This is very much undervalued, you are awesome!

  • thanx mate

  • thanx bro learnd allot

  • lol retuna

    its return haha

  • Thanks a lot for all that you do,....it's great, That avoid to loose time and it is very convenient, comfortable and understable. That allows us to test other thinks into each lesson. Bye, The french guy.

  • In python 3 the has_key() function was removed.

    Use " 'Mom' in tuna " instead of " tuna.has_key('Mom) "

  • @ryuichirapha Thanks, very helpful for we 3 users.

  • @ryuichirapha I don't understand, what's the syntax for it....

  • @ryuichirapha You can also do this in python 2. Or at least the one I have, 2.7 !!

  • I think you meant "cougar," not "MILF."

    I hope.

  • Comment removed

  • you like to fuck 87 year old women?

  • for python 3.2 i have learned that we use 'Key in Dict' i.e 'mom' in tuna. it returns boolean. The learning goes on @TheDesignSong

  • for python 3.2 i have learned that we use 'Key in Dict' i.e 'mom' in tuna. it returns boolean. The learning goes on @TheDesgnSong

  • I don't think that Python 3.2.2 the has_key() method

  • Comment removed

  • When you the method "tuna.has_key('Mom")

    and if you spelled "Mom" as "mom" its case sensitive so it will come up as false if you dont spell it the same way you did before

    Please thumbs this up so people can know about this so they dont get confused

  • @Lazaruzerick Another VERY important thing, in Python its "True" and "False" and not "true" and "false"

  • hahaha, 87 year old MILF. lmao.

  • your the best

  • like an associative array in php?

  • My mom's name is Lisa and my brother's name is Joe.... 0.0

  • @hetamalo is she a MILF?

  • i was trying hard to not find you funy but I lol`d @ mom being a casual sounding 87 year old milf Lol

  • tuna=ages gives the same result as tuna=ages.copy() so i don't really see the point

  • @pythonmaster1337 Because if you type ... tuna=ages ... tuna becomes a reference to ages not a copy of ages.

  • @pythonmaster1337 it is for use in algorithms and programs that you have to copy only portions of the dictionary

  • Wham Bam Sam!!!!!!

  • I can now finally remember my family's names.

  • How could I intergrate this into a raw_input or input search query?

  • Is there a way to do a reverse search in a dictionary? Mean, entering a value and getting a key?

  • Comment removed

  • Isnt it called a hash rather than a dictionary?

  • @Majskolvenz

    Either, apparently.

  • lawl. "She's a MILF" :P

  • I see why you like old women. ; )

    ....because your dad does.

  • If bucky pauses this video at 6:12 i will jump out of my chair

  • an 87 year old MILF???

    she must look very, very good for yer age! :-D

  • { 'Dad' : 42 , 'Mom' : ''87' }

  • I laughed so hard at

    "How old could she be.. uuh... 87!"

  • @Zerstoererh She's a milf. xD

  • thisvid.has_key('awesomeness')

    True

  • Hahaha 87, she's a milf. This guy is hilarious 

  • i really think that u can do anything, if u rule this 4 languages: Java/C# (almost the same^^), PHP , C and Phyton.

    watched today 24 of his tuts :D

  • Woah, an entire tutorial without a mention of Easyhoss. Are you feeling well?

  • if you're using Python 3.x has_key will not work. do ('Mom')in tuna

  • these are called arrays in other languages

  • @killcamike in java for examples.. but.. in arrays you gotta specify what type of variables they gonna be..

    (idk english)

  • i cant seem to use dictionaries i create in my "new window" and ill do

    print "words,words" + dictionary

    and when i do run it says "dictionary isnt described? can a string and dicitonary not mix?

  • @SOLOSHOCKcom I guess they are different data types...

  • She's a milf.

  • this is helping me with my homework right now ^_^

  • ha 2:59 "how old can she be...87,. she's a MILF." LOL!!

  • "mom 87 she's a milf" lol!

  • If anyone wants to know, if you're using v3, use "'Mom' in tuna" (no quotes)

  • The best part in this tutorial: 1:30

  • @11889music

    dont get it

  • @thecreapyandweirdone "We have a bro, and his name is Joe; Joe the bro"

  • python 2.6.1 tuna.has_key('mom')....in python 3... 'mom' in tuna

  • @Grigoris179 Thank you so much. I'llbe lost w/out your imput.

  • @dustinbrichardson in python 3... type.... 'apples' in tuna

  • >>>book={'Green':'Come on, its a fucking colour, why are you looking this up?'}

    Best dictionary EVER

  • dictionary = {'Bucky':'pure awesomeness' 'bucky's tuts':.......}

    ERROR: bucky's tuts are to great to compute!

    Hey that dictionary is wrong! Bucky is actually...

    breathtaking, awe-inspiring, magnificent, wonderful, amazing, stunning, staggering, imposing, stirring, impressive, mind-boggling, mind-blowing, jaw-dropping, excellent, marvellous.

    That is ¡¡¡¡¡¡¡¡¡¡BUCKYBUCKYBUCKYBUCKY­BUCKY!!!!!!!!!!!

    I LOVE PYTHON

  • @dustinbrichardson python 3 differs from 2 (2.6 2.7 etc) so if you wana follow bucky exactly you must download the 2.6 or 2.7 version of python

  • In the example where you use numbers inside a dictionary, it should be as follows -

    ages = {'Dad':42.0, 'Mom':87.0}

    You used strings in your example. Which is same as before. (Look at the color coding and also ' ' around the number returned.)

  • @neerajadsul There's nothing wrong with using the numbers as strings, they don't have to be any particular type.

  • Hey Bucky/Fellow commenters, I have a question for you all.

    I am n00bsauce, so I was just wondering how dictionaries/lists can be used when writing programs. I can make them work, but I'm not sure how when could be used.

    Thanks guys,

    ANorseHorse

    P.S. Bucky your tutorials are the bomb, they have taught me so much already. You are awesome. I salute you.

  • @ANorseHorse I work with different IR detectors, and I use the dictionaries to look up given readmodes based on parameters of files. e.g.: {1:'high-noise',16:'medium-noi­se',256:'low-noise'} Pretty useful things! Even dictionaries of dictionaries pop into use sometimes.

  • @jimmayl1 D: Sound pretty fancy!

    Thanks though, that would make sense.

  • what do we need dictionaries for?

  • Thanks po

  • how do you convert a list into a dictionary??

  • Lisa is a little girls name. You can't be old and named Lisa.

    Also, what do I use if I want to find the difference between two values tied to ... stuff?

    example: I want to find the difference between my sister's age and my own

    dif={'My age':'17','sis':'21'}

    What command do i use to find the diffrence between difference between dif['My age'] and dif['sis']?

  • This is for Python 2. In Python 3, the has_key method is no longer available; the "in" operator is used, instead. Instead of:

    tuna.has_key('Mom')

    use

    'Mom' in tuna

  • rofl "mom can be 87, she's a milf" ahahah

  • @TheBoyyini no1 asked

  • okay, I have some question. Which way is the most suitable to keep large variables?

    let:

    x, y, z, = "Bucky", "have", "tuna"

    --or---

    book={'x':'Bucky', 'y':'have', 'z':'tuna'}

  • "hmm 87 . she's a milf." nice one! :D

  • why does he always use the python shell instead of an ide like wing or idle?

  • FYI Python 3.0 or greater removed the "has_key" method.

    It is now simply: 'Key' in Dictionary name

    So for example where Bucky has: tuna.has_key('Mom')

    This would now be simply: 'Mom' in tuna

  • mom is 87, she's a milf....

  • I don't think some one would have a 42 year old dad and an 87 year old mom that "mom" would be old enough to be dad's mom.

  • I can't stop watching your tutorials. Good job man!

  • random question: what if I wanted to make a program that functioned like a folder? Like you start it up, you're asked which game/application on your hard drive you want to start. How do I start an .exe that's elsewhere in my hard drive? How do I make a program that ties .exe's to said program?

  • 3:00

    L O L :P

    Great tut.

  • Hi Bucky, I need ur help. I need software details by using that you are zoom in/ zoom out certain part of desktop as i seen in your video.

  • @Annu123456 It is called Camtasia Studio, probably version 6.

  • windows vista and win7 has a built-in software that does it for you (but it follows ur mouse)

  • @augustuen Whats the name?

  • @Raener I don't know exactly, but it has an really ovbious name

  • Do any one know about informatica/cogns training online ?Plz plz help me on that

  • Hi, i tried some thing and its worked then i remembered the vedio-18 where we got knowledge about "input" 7"raw_input". IF we want to work with number then need to use "input" but i was using "raw_input".

    Now correct answer is :-

    x={1:'Apple',2:'mango',2:'oran­ge'}

    y=input("Please enter value from 1 to 3 and see suprise for u")

    print y

    x[y]

    print"u love sweet" +x[y]

    input("please enter any ket to exit")

  • This program works better:

    x={1:'Apple', 2:'mango', 3:'orange'}

    y=input("Please enter value from 1 to 3 and see suprise for you: ")

    x[y]

    print"u love sweet " +x[y]

    raw_input("please enter any key to exit")

  • Thaks a lot Sir

  • i write one program but its not working..plz help.

    x={1:'Apple',2:'mango',2:'oran­ge'}

    y=raw_input("Please enter value from 1 to 3 and see suprise for u")

    print"u love sweet" +x[y]

    raw_input("please enter any ket to exit")

  • @Annu123456 x = {'1':'apple','2':'mango','3':'­orange'} that's the correction to your line 1.

  • Thanks a lot bucky

  • Very good stuff bucky hats off to you my friend

  • lol this guys funny as hell

  • The values can also be an integer. I added the ages of my 'parents' which worked by leaving out the quote marks around them. I also used numbers as keys, like and ID. :)

    These tutorials make this SO easy and fun!

  • retuna

  • omg there are so many of these

  • I believe at 87 you'd be a GMILF not a MILF.

  • hahaha, joe the bro, and mom the milf. this guy is funnier than he thinks

  • Dictionary can be used for setting multiple variables with ease.

  • this guy is awesome

  • haha he said milf

  • Good one

  • dictionaries used for creating music player?

  • Whats the difference between 2.6.1 and 2.6.2? because mines version 2.6.2 of python but yours is 2.6.1...

  • in 2.6.2 are some bugs fixed........

  • I dont' get it, where would we use dictionary, I mean, in what programs?

  • you can use it in anything. i don't let term confuse yeah

  • well, web templating frameworks (ie django) use dictionaries to pass objects to the html script. The name of the object is whats referenced in the html code.

  • Django uses Context, not 'only' dicts ;)

  • telephone books f.e.

  • I used dictionaries in a small Phonebook program I made! :D

  • I guess you can use the dictionary method in dictionary programs xD

  • You can use it nearly everywhere ;)

    I'm coding php, python/django at work and java for the university and I'm using dicts in most of the programs.

    dicts are nice for returning more than one var from a function ( ok, using objects is often better ;) )

    One thing I missed in the tutorial is that you can insert everything in an dict, not only strings ( or integers saved as strings :-/ )

  • using tuna = ages gives the same thing as tuna = ages.copy()

    is there any advantage in using copy()?

  • its different. If you "tuna=ages" then you are telling the program to store the information for "tuna" and "ages" in the same spot. So if you change something in "ages" you also change that same thing in "tuna".

    however, if you "tuna=ages.copy()" then it copies the information in "ages" to the memory location of "tuna." so you can change ages without changing tuna and vice versa.

  • @sirtwizt no, you're wrong..

  • @sirtwizt Oh now I get it. Awesome, thanks dude (:

  • @sirtwizt

    it is the same thing with JAVA =) ..

  • yay!!!

  • Thx Great Vid!!

  • Cool! :)

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