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

Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Andrew Lipscomb says:

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

Utsav Mangla says:

Why was in the result/outcome the order of elements in the set different from the orignal set? :O

[InsertWittyNameHere] says:

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

MilkyCarton says:

1:44 You’re welcome 😉

Hải Sơn Dương says:

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

DaCurse0 says:

for for for ferra

Modern Warrior says:

Remember guys,
If you smoke you are an idiot,
but you can have beer on your regular groceries, twice (cos ur drunk), and its TOOOTALLY FIIINE.
Then wonder why you have hiccups/burps.

Just smoke as much as you hate your lungs, and consume alcohol as much as you hate your liver.

Like if you prefer hiccups/burps from Bucky, or comment if you rather listen to gentle farts from Sally.

mahbub nayeem says:

I thought u starting a horror story

Abdullah Fadhl says:

why you did not loop throw the set??

Jainil Desai says:

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


you need some milk

Shlok Walia says:

It’s 2:08AM in india and i’m in love with python because of thenewboston..!!

Bill DWP says:

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.

kishlay kumar says:

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

SplitTrix says:

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

nshusa says:

I love this language its fun 🙂

Gabriel MacDonald says:

can I get subs

Elyria says:

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

candylantis says:

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

Future-Tech 1.0 says:

@thenewboston you have great fun tutorials. Its helpful

mrmynameis19 says:

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


items = {‘milk’,’oil’,’beef’,’chikens’,’lotion’,’tea’}

check=input(“check avilablity : “)
for x in items:
if x == check:
print(x,” already in the list”)
print(“New item found”)

R3N3G4DE says:

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

golden pie says:

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

Mariah Smith says:

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

Alex Stefanov says:

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*

Žan Hribar says:

why does this code give me error?? and i have pycharm 3.4.4
groceries = {‘beer’, ‘pizza’, “chicken”, ‘lotion’, ‘chocolate’, ‘beer’}

groceries = {‘beer’, ‘pizza’, “chicken”, ‘lotion’, ‘chocolate’, ‘beer’}
SyntaxError: invalid syntax

Bai Bing says:

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
return car_cost
def trip_cost (days, x):
trip_cost = hotel_cost (days) + plane_ride_cost (x) + rental_car_cost (days)
return trip_cost

kelvin lau Kelvin says:


Shuja Ali says:

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

MEHH says:

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

Songbird says:

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

zied chekir says:

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

Shicheng Guo says:

unpacking argments:


Adrian Voicu says:

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

Fatih Altunay says:

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

VOLUME 51 says:

video starts at 1:05

hacker world says:

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

defialpro says:

groceries = {‘rope’,’duct tape’,’shove’,’saw’,’plastic bags’,’buckets’,’bleach’,’acetone’,’orange juice’,’knives’}

suda moon says:

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

Han Jiali says:

I like to watch this video, it helps me a lot due to a beginner, and haha, I know what’s in walmart 🙂

They Pheaktra says:

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

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!