前面已经说过了,print()函数括号里加上字符串,就可以实现输出 >>> print('This is Python!') This is Python! print()函数也可以接受多个字符串,用,隔开 >>> print('This is python!','It is a programming language.') This is python! It is a programming language 打印的时候,碰到逗号就会输出一个空格. 其实还可以这样
print("[+]welcome to python3") while True: num = input("please input a num:") if num.isnumeric() == True: x = num break else: print("[-]输入失败,必须输入为数字,请重新输入~") print("[+]i got "+x) #输入大于0,小于100的整数或者小数#isinstance(x,typ