fork(1) download
  1. course = "Python Programming"
  2. score = 95.5
  3. sentence = f"{course}课程的成绩是{score}分"
  4. print(sentence)
  5. print(type(score))
  6. course_under = course.replace(" ", "_")
  7. print(course_under)
  8. count_o = course.count('o')
  9. print("字母o出现的次数:",count_o)
Success #stdin #stdout 0.08s 14072KB
stdin
汤旭
stdout
Python Programming课程的成绩是95.5分
<class 'float'>
Python_Programming
字母o出现的次数: 2