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