國立暨南國際大學 103 學年度第一學期小考試卷

科目名稱:計算機概 論 開課系所:資訊工程 學系 考試日期 2014.9.23
系所別:
年級:
學號:
姓名:
考試時間 16:45-17:00
  1. (10%) Determine whether the following code is correct or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).
    # Output Formatting
    print('A', end='')
    print('A', end='')
    print('A','A','A',sep="'")

  2. (10%) Determine whether the following code is correct or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).
    # Simultaneous Assignment
    x, y = 9, 22
    y = x
    x = y
    print(x, y)

  3. (10%) Determine whether the following code is correct or not.  If it is correct, predict its output.  If it is incorrect, point out the mistake(s).
    # Definite Loop
    for i in range(5):
        for j in range(5):
            print(i, end='')

    print()