fork download
  1. course = "Python Programming"
  2. score = 95.5
  3. # 使用 f-string 拼接(注意原句没有空格在课程和成绩之间)
  4. sentence = f"{ course }课程的成绩是{score}分"
  5. print( sentence )
  6. # 输出score的数据类型
  7. print( type(score))
Success #stdin #stdout 0.1s 14164KB
stdin
Standard input is empty
stdout
Python Programming课程的成绩是95.5分
<class 'float'>