第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

我在執(zhí)行 python <function personAge at 0x101fe6050>

我在執(zhí)行 python <function personAge at 0x101fe6050>

富國滬深 2021-07-15 14:05:00
我正在嘗試為計(jì)算機(jī)科學(xué)課程完成這個(gè)程序,但我遇到了這個(gè)錯(cuò)誤你好特里斯坦維納。您是 0x101fe6050 歲的函數(shù) personAge。為什么我得到而不是年齡?`#This program calculates a users age while collecting the user's  #birth year, the user's first and last name, the current year #and whether the user has had their birthday yet. firstName = raw_input("Please enter your first name")#Get the first name lastName = raw_input("Please enter your last name")#Get the last name birthYear = int(input("What is your birth year?"))#Get the birth year currentYear = int(input("What is the current year?"))#Get the current yearbirthdayYet = raw_input("Have you had your birthday yet? [1 for yes/2 for no]")#Ask if the user has had their birthdayage = 0def fullName (firstName, lastName):   outStr = firstName +" "+lastName    return outStrdef personAge(birthYear, currentYear, birthdayYet):   if birthdayYet == 1:       print(currentYear - birthYear)   if birthdayYet == 2:      age = currentYear - birthYear - 1      return str(age)def printMsg(personName,personAge):   return ("Hello" + " " + str(personName) + "." + " " + "You are" + " " + str(personAge) + " " + "years old.")personName = fullName(firstName, lastName)userAge = personAge(birthYear, currentYear, birthdayYet)finalMsg = printMsg(personName, personAge)print finalMsg`
查看完整描述

2 回答

?
繁花不似錦

TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超4個(gè)贊

finalMsg = printMsg(personName, personAge)

應(yīng)該

finalMsg = printMsg(personName, userAge)

personAge是您用來獲取人員年齡的函數(shù)。userAge是人的實(shí)際年齡。


查看完整回答
反對(duì) 回復(fù) 2021-07-28
?
蕪湖不蕪

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超7個(gè)贊

代替 …

finalMsg = printMsg(personName, personAge)

… 和 …

finalMsg = printMsg(personName, userAge)

記住personAge是一個(gè)函數(shù)而不是一個(gè)數(shù)字。


查看完整回答
反對(duì) 回復(fù) 2021-07-28
  • 2 回答
  • 0 關(guān)注
  • 250 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)