用python解决,需要完整的代码和运行结果截图🆘

输入一个数x,输出打印其平方根,要求能捕获处理
x不能为负数的情况。


x = input('x=')
if int(x) < 0:
    print('x为负')
else:
    print(float(x) ** 0.5)