Python Programming Tutorial – 19 – My trip to Walmart and Sets

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

44 responses to “Python Programming Tutorial – 19 – My trip to Walmart and Sets”

  1. thisuserhasaname Avatar

    woha! , bucky 2 beers to a list , you must be an alcoholic , that's not allowed.

  2. Žan Hribar Avatar

    why does this code give me error?? and i have pycharm 3.4.4
    groceries = {'beer', 'pizza', "chicken", 'lotion', 'chocolate', 'beer'}
    print(groceries)

    groceries = {'beer', 'pizza', "chicken", 'lotion', 'chocolate', 'beer'}
    ^
    SyntaxError: invalid syntax

  3. Hussein Hourani Avatar

    Why did you use curly brackets instead of square? Whats the difference?

  4. Fatih Altunay Avatar

    it is a 4:37 length video and first 2:16 is ridiculously trivial

  5. candylantis Avatar

    staring guy looks at groceries, when Bucky is gone to get something, man adds tuna and beer.

  6. kishlay kumar Avatar

    Why the order of the groceries are shuffled??? (After printing)
    That's weird!!

  7. Shicheng Guo Avatar

    unpacking argments:

    function(*list)

  8. SplitTrix Avatar

    What the heck
    Video was recorded on August 29th 2014
    But Video was uploaded on August 28th 2014?
    Illuminati?

  9. Bai Bing Avatar

    Guys, I'm making a python program to calculate the money I spent in a vacation but the program keep showing this message "cannot concatenate str and nonetype objects python error". Can u guys help me out?

    def hotel_cost (nights):
    return 140 * nights
    def plane_ride_cost (city):
    if city == "Charlotte":
    city_cost = 183
    return city_cost
    elif city == "Tampa":
    city_cost = 220
    return city_cost
    elif city == "Pittsburgh":
    city_cost = 222
    return city_cost
    elif city == "Los Angeles":
    city_cost = 475
    return city_cost
    def rental_car_cost (days):
    car_cost = days * 40
    if days >= 7:
    car_cost -= 50
    return car_cost
    elif days >= 3:
    car_cost -= 20
    return car_cost
    else:
    return car_cost
    def trip_cost (days, x):
    trip_cost = hotel_cost (days) + plane_ride_cost (x) + rental_car_cost (days)
    return trip_cost

  10. Andrew Lipscomb Avatar

    duct tape and lotion? it puts the lotion on the skin

  11. Elyria Avatar

    Alright beer lotion duct tape beer… Wait a sec! Did I forget the chloroform!?

  12. [InsertWittyNameHere] Avatar

    It got creepy after beer, duct tape, and lotion. What are you doing with those?

  13. mrmynameis19 Avatar

    why does the first set print out of order? shouldn't it print the same order as the groceries={….}?

  14. hacker world Avatar

    sir please how to input and print out the array in python

  15. Jamel Stringer Avatar

    Bucky, why is duct tape usually on your list?!

  16. Future-Tech 1.0 Avatar

    @thenewboston you have great fun tutorials. Its helpful

  17. R3N3G4DE Avatar

    it says in the bottom right corner 29. of August yet this video was published 28.
    dafuq?!

  18. golden pie Avatar

    If anyone is wondering, how Bucky looks like do watch his CSS tutorial.

  19. Abdullah Fadhl Avatar

    why you did not loop throw the set??

  20. Hải Sơn Dương Avatar

    again, an excellent video! I love it ~^o^~

  21. Alex Stefanov Avatar

    4:04 downloads your app, runs it Oh yeah, you need milk! adds milk to the grocery list You already have milk hoss! deinstalls app

  22. Youssef Samwel Avatar

    you need some milk

  23. They Pheaktra Avatar

    Nice example. I still don't understand, what is different between [ ] and { } in this example?

  24. Shritej Chavan Avatar

    What's the difference in the use of curly braces & square braces ?

  25. zied chekir Avatar

    wondering why the set items werent printed in the same order as u wrote them

  26. Jainil Desai Avatar

    Question : i wonder according to which order the elements in a set appear….have observed tht they dont get saved in the order we enter..

  27. Bill DWP Avatar

    I'm really confused does this code only work with Python 3 and higher. I downloaded Pycharm Community and it only supports 2.7, but the libraries only seem to work with Python 3.

  28. MilkyCarton Avatar

    1:44 You're welcome 😉

  29. Gai Cheng Avatar

    for a in b:
    for b in a

  30. Songbird Avatar

    When it printed the list, it printed the items in a different order than they appear in the program.  Why?

  31. DaCurse0 Avatar

    for for for ferra

  32. venktesh rao Avatar

    the way you say the word 'item' is weird. Just wanted to point that out.

  33. Shuja Ali Avatar

    Sets seem to be deprecated in Python version 2.6.

    I even tried:
    from sets import Set
    groceries = Set(['Bread', 'Milk', 'Sugar', 'Pop', 'Milk'])

    Error = DeprecationWarning: the sets module is deprecated from sets import Set

    Whats the alternative?

    And thanks for the tutorials

  34. Maruf Usman Avatar

    items = {'milk','oil','beef','chikens','lotion','tea'}

    check=input("check avilablity : ")
    for x in items:
    if x == check:
    print(x," already in the list")
    break
    else:
    print("New item found")
    #items+check;
    break

  35. Mariah Smith Avatar

    the burping/ bodily functions is/are getting kind of gross

  36. Adrian Voicu Avatar

    Why did the set output in another order than what you entered?

  37. Stefan Ovidiu Oancea Avatar

    watching this exactly one year after it was recorded 😛 happy birthday

  38. suda moon Avatar

    i started watching this video at 12:35am, idk why but i get such a kick at comparing our times cause theyre sometimes at like 3 in the morning

  39. nshusa Avatar

    I love this language its fun 🙂

  40. Utsav Mangla Avatar

    DID ANYONE SAW THAT?!?
    Why was in the result/outcome the order of elements in the set different from the orignal set? :O

  41. Anthony Armfield Avatar

    Am I the only one who saw that after the program was ran with the "if" statement was included, the order of the output was mixed up?

Leave a Reply

Your email address will not be published. Required fields are marked *