输入一个数x,输出打印其平方根,要求能捕获处理x不能为负数的情况。
x = input('x=') if int(x) < 0: print('x为负') else: print(float(x) ** 0.5)