#第1题
print('hello world')
print(100)
print(3.1415926)
print(complex(3,2))
print(True)
#第2题
a=input()
y= chr(ord(a)+32) if a>='A' and a<='Z' else chr(ord(a)-32)
print(y)
有帮助请采纳
s = "你好" # 字符串
a = 10 # int
f = 11.11 # 浮点数
i = 2
com = 10*i + 2j
b = True
print(s,a,f,com,b) # 打印
# 字符串转换
a = input("请输入一个字母").strip()
Y = (chr(ord(a) + 32) if ord("A") <= ord(a) <= ord("Z") else chr(ord(a) - 32))
print("输入字母: {},转换结果: {}".format(a,Y))
如果觉得答案对你有帮助,请点击下采纳,谢谢~
直接判断
print(1)
print(1.33242)
print(complex(5,3))
print(False)
change=input()
if change>"A" and change<"Z":
answer=chr(ord(change)+32)
else:
answer=chr(ord(change)-32)
print(answer)