
Python3
Authored by 趙怡梅 趙怡梅
Computers
9th Grade
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
if input()=1:
print(int('請問')+"1")
若輸入2
請問輸出為?
提示:注意變數型態
2
'請問1'
"1"
程式錯誤,無法輸出
Answer explanation
If後方應接布林值==而非=
字串'請問'也無法被轉為數字
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
#print('c')
if not (1==1):
print('a')
else:
print('b')
print('d')
'''
print('e')
'''
請問輸出包含哪些字母?
提示:注意註解和if….else的用途
bd
acd
bcde
acde
Answer explanation
print('c'), print('e')皆被註解掉了,不會運行
而print('a')需要(1==1)不成立才行
所以也不可能運行
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
print(str(not(int('1')==1)))
請問輸出的資料類型為?
提示:逐次處理函數去括號
整數int
字串str
布林值bool
程式錯誤,無法輸出
Answer explanation
int('1')==1
>>>True
not(True)
>>>False
str(False)
>>>字串'False'
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
a=int(input()+input())+int(input())
b="1"+str(a)
print(b)
若分別輸入1,2,3
請問輸出為?
提示:字串相加會合併
16
115
7
1123
Answer explanation
input()+input()
'1'+'2'
>>>'12'
Int('12')+int('3')
>>>15
"1"+str(15)
>>>"115"
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
a=0
b=2
if a>b
print("a>b")
else:
print('a不小於b')
請問輸出為?
提示:注意細節
"a>b"
'a不小於b'
False
程式錯誤,無法輸出
Answer explanation
第三行的if缺少冒號
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
in1=int(input('輸入被除數'))
in2=int(input('輸入除數'))
print('商為:'+str(in1//in2))
print("餘數為_____n1%in2))
請問底線處的程式碼應為?
提示:注意括號、引號等需要成對的符號
//
用來求除完後的整數部分
例如7//2
>>>3
%
用來求除完後的餘數
例如11%9
>>>2
: ',str(i
: '+str(
:"+str(i
: '+int(i
Answer explanation
第四行的
"餘數為
必須要有雙引號結尾
+和,都是字串組合之功用,這裡可互換
Str是為了將數字修改為字串,故不可改成int
結尾的i是為了與n1合在一起稱為in1
否則n1為一個未定義的變數
故不可省略
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
a=1
b=3
c=a+b+1
print(a+b+c)
請問輸出為?
提示:逐次進行加法
7
8
9
10
Answer explanation
變數c為1+3+1
>>>5
輸出為1+3+5
>>>9
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
12 questions
Object Oriented Programming And Flowchart Symbols
Quiz
•
9th - 12th Grade
10 questions
Programming Constructs_Y10
Quiz
•
9th - 12th Grade
10 questions
Управление циклом: else . 8 класс
Quiz
•
8th Grade - University
10 questions
Python - Operators and Conditional Statement
Quiz
•
3rd - 10th Grade
10 questions
Programació amb codi: Python
Quiz
•
9th Grade
10 questions
IGCSE Computer Science - Input Devices
Quiz
•
9th - 11th Grade
12 questions
Python
Quiz
•
7th - 9th Grade
14 questions
9.1.2 - Starter Quiz
Quiz
•
7th - 11th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade