코딩 하는 사람만 웃기는 유머
A wife asks her husband, "Could you please go shopping for me and buy one carton of milk, and if they have eggs, get 6."
A short time later the husband comes back with 6 cartons of milk. The wife asks him, "Why did you buy 6 cartons of milk?"
He replied, "They had eggs."

totalCartonsofMilk = 1If(eggs) {totalCartonsofMilk = 6}return totalCartonsofMilk
var totalCartonsOfMilk = hasEggs()? 6 : 1;
해결책까지 제시해줌
한국에서는 싸움남 ㅋㅋㅋㅋ

A short time later the husband comes back with 6 cartons of milk. The wife asks him, "Why did you buy 6 cartons of milk?"
He replied, "They had eggs."
totalCartonsofMilk = 1If(eggs) {totalCartonsofMilk = 6}return totalCartonsofMilk
var totalCartonsOfMilk = hasEggs()? 6 : 1;
해결책까지 제시해줌
What the wife actually said:
.#!/usr/bin/env pythonfrom SuperMarkets import check_out, find_markets, inventorydef run_errand(milk, eggs): shopping_cart = [] if 'milk' in inventory and 'eggs' in inventory: shopping_cart.append(milk * 6) elif 'milk' in inventory and 'eggs' not in inventory: shopping_cart.append(milk) else: print 'Store has no milk. Try another.' find_markets() check_out(shopping_cart)if __name__ == '__main__': run_errand(milk='milk', eggs='eggs').What the wife should have said to her programmer husband:
.#!/usr/bin/env pythonfrom SuperMarkets import check_out, find_markets, inventorydef run_errand(milk, eggs): shopping_cart = [] if 'milk' in inventory and 'eggs' in inventory: shopping_cart.append(milk + eggs) elif 'milk' in inventory and 'eggs' not in inventory: shopping_cart.append(milk) elif 'eggs' in inventory and 'milk' not in inventory: shopping_cart.append(eggs) print 'Buy eggs, then go to another store for milk.' find_markets() else: print 'Store has no eggs or milk. Try another.' find_markets() check_out(shopping_cart)if __name__ == '__main__': run_errand(milk='milk', eggs='eggs' * 6)한국에서는 싸움남 ㅋㅋㅋㅋ

댓글 13개
cshop2
12년 전
if(egg_exists()) { buy('milk', 6); } else { buy('milk', 1); }
이걸 읽으면 계란이 존재하는 경우 우유 6개, 아니면 한개 사.
이렇게 읽히는데요.
if(eqg != 'exists') { buy('milk', 1); } else { buy('milk', 6); }
이게 더 정확하지 않을까요?
물론 결과는 같지만요.... ㅎㅎㅎㅎ
이걸 읽으면 계란이 존재하는 경우 우유 6개, 아니면 한개 사.
이렇게 읽히는데요.
if(eqg != 'exists') { buy('milk', 1); } else { buy('milk', 6); }
이게 더 정확하지 않을까요?
물론 결과는 같지만요.... ㅎㅎㅎㅎ
cshop2
12년 전
한국어로는 잘 모르겠는데 저 아줌마 표현은 영어로는 매우 정상적인 표현입니다. ㅎㅎㅎ
단지 그 순간 프로그래머 아저씨가 아줌마의 요구사항을 프로그래밍적 으로 이해했을뿐... ㅋㅋㅋㅋ
단지 그 순간 프로그래머 아저씨가 아줌마의 요구사항을 프로그래밍적 으로 이해했을뿐... ㅋㅋㅋㅋ
JMoon
12년 전
buy('milk', 1);
echo "ah"; //ㅋㅋ
if(egg_exists()) {
buy('milk', 6);
}
ㅋㅋㅋㅋ
echo "ah"; //ㅋㅋ
if(egg_exists()) {
buy('milk', 6);
}
ㅋㅋㅋㅋ
게시판 목록
자유게시판
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 |
|
1주 전 | 16 | |
| 199658 | 2개월 전 | 148 | ||
| 199657 | 2개월 전 | 263 | ||
| 199656 | 2개월 전 | 200 | ||
| 199655 | 2개월 전 | 142 | ||
| 199654 |
|
2개월 전 | 192 | |
| 199653 |
|
2개월 전 | 106 | |
| 199652 |
|
2개월 전 | 216 | |
| 199651 | 2개월 전 | 210 | ||
| 199650 | 2개월 전 | 144 | ||
| 199649 | 2개월 전 | 201 | ||
| 199648 | 2개월 전 | 245 | ||
| 199647 | 2개월 전 | 247 | ||
| 199646 | 2개월 전 | 246 | ||
| 199645 | 2개월 전 | 152 | ||
| 199644 | 2개월 전 | 277 | ||
| 199643 |
비버팩토리
|
2개월 전 | 209 | |
| 199642 | 2개월 전 | 388 | ||
| 199641 |
bbebbee
|
2개월 전 | 152 | |
| 199640 |
jaick
|
2개월 전 | 175 | |
| 199639 | 2개월 전 | 266 | ||
| 199638 | 2개월 전 | 208 | ||
| 199637 | 2개월 전 | 200 | ||
| 199636 | 2개월 전 | 231 | ||
| 199635 | 2개월 전 | 215 | ||
| 199634 |
비버팩토리
|
2개월 전 | 153 | |
| 199633 | 2개월 전 | 126 | ||
| 199632 | 2개월 전 | 222 | ||
| 199631 | 2개월 전 | 235 | ||
| 199630 | 2개월 전 | 226 | ||
| 199629 | 2개월 전 | 230 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기