求Python代码!!
题目:输入一组数字,用逗号隔开,如果输入为空,提示错误信息,否则输出这组数字中的最大值。
while True:
userInput = input('请输入一组数字,用英文逗号隔开: ')
if userInput:
userInput = [ int(i) for i in userInput.replace(',',',').split(',') ]
print('里面的最大值是:',max(userInput))
break
elif userInput == '':
print('错误信息')
continue