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

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在 int(input); 中將單詞作為答案;

如何在 int(input); 中將單詞作為答案;

炎炎設(shè)計(jì) 2021-11-23 19:44:17
import timeimport randomlista=('ACE','2','3','4','5','6','7','8','9','10','BOY','LADY','KING')print('You have got',random.choice(lista))i=int(input('Do you want to get a new card'))YES=1if i == YES:    print('Your second card is:',random.choice(lista))我想將 aYES作為答案,但它不起作用。你能向我解釋一下我該怎么做嗎?
查看完整描述

2 回答

?
倚天杖

TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超3個贊

嘗試這個:


import time

import random

lista=('ACE','2','3','4','5','6','7','8','9','10','BOY','LADY','KING')

print('You have got',random.choice(lista))


i = input('Do you want to get a new card: ')


if i == "YES":

    print('Your second card is:',random.choice(lista))

您使用“是”(字符串)作為整數(shù),不能將整數(shù)與字符串進(jìn)行比較。


查看完整回答
反對 回復(fù) 2021-11-23
?
小唯快跑啊

TA貢獻(xiàn)1863條經(jīng)驗(yàn) 獲得超2個贊

import time

import random


lista=('ACE','2','3','4','5','6','7','8','9','10','BOY','LADY','KING')

print('You have got',random.choice(lista))

i=int(input('Do you want to get a new card'))

YES=1

if i == YES:

    print('Your second card is:',random.choice(lista))

我想將 aYES作為答案,但它不起作用。你能向我解釋一下我該怎么做嗎?


查看完整回答
反對 回復(fù) 2021-11-23
  • 2 回答
  • 0 關(guān)注
  • 180 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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