Discuss / Python / 为什么输入10还是返回adult呢?

为什么输入10还是返回adult呢?

DJSHICHAOREN

#1 Created at ... [Delete] [Delete and Lock User]

age = raw_input()
if age >= 18: print 'adult' else: print 'teenager'

为什么输入10还是返回adult呢?

DJSHICHAOREN

#2 Created at ... [Delete] [Delete and Lock User]

看了评论,原来input()是输入数字啊

Flybeta

#3 Created at ... [Delete] [Delete and Lock User]

呵呵,长知识了。


  • 1

Reply