fork download
  1. # your code goes here
  2. #创建一个字符串变量username,值为:xiaoming;再创建一个变量age,值为:18;使用字符串f格式化拼接为”我的名字叫xiaoming,今年18岁”并在控制台输出。(15分)
  3. username = 'xiaoming'
  4. age = 18
  5. hello = f'我的名字叫{username},今年{age}岁'
  6. print(hello)
  7. # 把变量username的值转换为大写输出,输出username变量的长度。
  8. print(username.upper ())
  9. print(len(username))
Success #stdin #stdout 0.08s 13996KB
stdin
Standard input is empty
stdout
我的名字叫xiaoming,今年18岁
XIAOMING
8