本文共 405 字,大约阅读时间需要 1 分钟。
- Write a function called decision that takes a string as input, and then checks the number of characters. If it has over 17 characters, return “This is a long string”, if it is shorter or has 17 characters, return “This is a short string”.
def decision(chars): if len(chars) > 17: return "This is a long string" else: return "This is a short string"chars = input()print(decision(chars))
转载地址:http://firci.baihongyu.com/