※ 本文轉寄自 ptt.cc, 文章原始頁面
標題

[徵女] 妳寫Python嗎?

時間
最新2019-05-31 08:44:00
留言42則留言,36人參與討論
推噓17 ( 22515 )
class PttUser: def __init__(self, height, weight, city, gender, age, job, verbose): self.height = height self.weight = weight self.city = city self.gender = gender self.age = age self.job = job self.verbose = verbose self.bmi = weight / (self.height ** 2 / 10000) self.hobbies = {"ptt"} my_data = { "height": 176, "weight": 74, "city": "Taipei", "gender": "male", "age": 27, "job": "software engineer" } my_data["verbose"] = "no smoking, no drinking, outgoing, hen好相處" my_hobbies = {"dancing", "marvel", "weight training", "games", "TV series (EA or KOREAN)"} me = PttUser(**my_data) me.hobbies.update(my_hobbies) def calc_my_score(me, you): score = 0 if 155 < you.height <= 160: score += 20 elif you.height <= 155: score += 30 if you.bmi < 22: score += 20 if 22 <= you.age <= 30: score += 20 score += len(me.hobbies.intersection(you.hobbies)) * 20 return score user2calc = { me: calc_my_score, # and all others including you } for you,calc_your_score in user2calc.items(): my_score = calc_my_score(me, you) your_score = calc_your_score(you,me) if my_score + your_score > 140: if you.gender == "female": print("please send me a letter, we can exchange our photos if you want") if you.gender == "male": print("thanks but I like girls") -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 58.114.212.150 ※ 文章網址: https://www.ptt.cc/bbs/AllTogether/M.1559132667.A.188.html

42 則留言

※ 編輯: as30385438 (58.114.212.150), 05/29/2019 20:26:58

joaya, 1F
有特色223.136.34.197

a3236852, 2F
哈哈哈哈有點幽默欸114.137.220.117

pannacotta23, 3F
徵男?49.219.162.231

Tenno081, 4F
你是不是標錯了?應該標徵女吧?114.136.246.45

CGHS, 5F
徵男? 祝福了! 雖然我不是SW但看得懂XD27.52.62.157

max241, 6F
這title 跟內容 直接critical error123.193.6.110

BeautyIsDie, 7F
but you want a man in the title?123.192.223.72

VivianChen01, 8F
徵男 ? 0.0140.114.225.18

sam0991, 9F
祝福110.26.235.105
※ 編輯: as30385438 (58.114.212.150), 05/29/2019 20:31:20
感謝大家,寫code寫到腦殘XD
※ 編輯: as30385438 (58.114.212.150), 05/29/2019 20:32:04

iLeyaSin365, 10F
你是不是徵求性別弄錯了42.70.177.6

c5i3n1g, 11F
看程式碼之前比較喜歡先看註解42.75.163.197

chenycal, 12F
以前人家都說mis都怪怪的,我原本不相信115.82.16.112

chenycal, 13F
直到........115.82.16.112

banana800908, 14F
不會寫Python,但是看得懂XD111.71.102.68

JJHu, 15F
其實感覺只要看得懂英文即可114.39.193.163

andyher, 16F
無聊150.117.2.57

rtyleo, 17F
徵男無誤......223.137.64.188

glender, 18F
有創意110.28.203.241

hakosaki, 19F
加油好嗎......換做我是女生也直接pass1.200.218.252

hakosaki, 20F
感覺你的生活只有程式碼1.200.218.252

pureguy, 21F
我女生,我看完了,幽默給推XD111.71.70.133

bmw606042001, 22F
好宅36.229.254.163
我不是MIS哦,SW跟MIS還差滿多的 然後會走這行當然就是熱愛coding啦,宅也是我的一部分 能接受的女生再寄信給我吧
※ 編輯: as30385438 (58.114.212.150), 05/29/2019 22:25:55

jingpikapika, 23F
太有梗了推~114.136.84.131

dreamed, 24F
...114.137.179.173

Tenno081, 25F
有信了,恭喜阿114.136.246.45

doublelove82, 26F
也覺得會英文就看得懂了39.12.133.5

Rokopeko, 27F
python還真直覺,物件就這樣寫啊39.9.137.242

Giuliani, 28F
XDDDDDD180.217.148.188

BJoker8672, 29F
Line51 AttributeError'NoneType' o166.216.158.95

BJoker8672, 30F
bject has no attribute 'height'166.216.158.95

parisdog, 31F
好想學42.77.208.70

ABC610478, 32F
自以為118.232.12.92

Hirajima, 33F
會英文就看得懂了啦www114.45.207.42

dream1103, 34F
Python本是最好上手的程式語言,語法也220.132.72.92

dream1103, 35F
是最簡略的220.132.72.92

harry7319, 36F
101.13.146.238

okita3088, 37F
如果是我連看都不想看117.19.212.115

walhalla, 38F
沒作過SA膩,最重要的車房存款年薪都沒有211.21.123.187

costello, 39F
哈哈 好宅114.35.206.216

cwinny, 40F
雖然不會寫但看得懂,沒想到這個這麼直觀223.137.161.146

cwinny, 41F
喔長知識223.137.161.146

hhc16, 42F
覺得超棒的49.216.16.136