Python学习笔记-条件判断

xiaoxiao2021-02-27  438

# input()返回的是字符串 # 必须通过int()将字符串转换为整数 # 才能用于数值比较: age = int(input('Input your age: ')) if age >= 18: print('adult') elif age >= 6: print('teenager') else: print('kid')
转载请注明原文地址: https://www.6miu.com/read-3909.html

最新回复(0)