python高级练习题库实验2(A)部分

文章目录

  • 题目1
    • 代码
    • 实验结果
  • 题目2
    • 代码
    • 实验结果
  • 题目3
    • 代码
    • 实验结果
  • 题目总结


题目1

编写一个程序,根据用户输入显示课程信息。程序应显示收据,如下例所示。
输入:
u
输出:
Which degree do you choose? Undergraduate (U) or Postgraduate §: U

Course summary:
Location: Wollongong, Liverpool
Duration: 3 years full-time or part-time equivalent

输入:
P
C
Which degree do you choose? Undergraduate (U) or Postgraduate §: P
Which course do you choose? Master by Coursework © or Master by Research ®: C

Course summary:
Location: Wollongong, Liverpool
Duration: 1.5-2 years full-time or part-time equivalent

输入:
P
R
输出:
Which degree do you choose? Undergraduate (U) or Postgraduate §: P
Which course do you choose? Master by Coursework © or Master by Research ®: R

Course summary:
Location: Wollongong
Duration: 2 years full-time or part-time equivalent

代码

d = input("Which degree do you choose? Undergraduate (U) or Postgraduate (P): ")
course = ""
if d == "P" :
    course = input("Which course do you choose? Master by Coursework (C) or Master by Research (R): ")

你可能感兴趣的:(python考试复习小题库,python)