| 
 | 
 
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册  
 
x
 
几个python简单多选题,求问正确答案 
Q1. Which of the following functions that reads a data from the user and returns the same data as a string, 
back to the program 
a. eval_input() 
b. output() 
c. input() 
d. str_input() 
e. none of the above 
Q2. What is the value of price after the execution of the following line: 
price = int(68.549) 
a. 69 
b. 68 
c. 68.55 
d. 68.6 
e. 68.549 
Q3. Which of the if clauses below that determines whether y is in the range 2 through 6, inclusive? 
a. if 2 < y or y > 6: 
b. if 2 > y and y < 6: 
c. if y >= 2 and y <= 6: 
d. if y >= 2 or y <= 6: 
e. none of the above 
Q4. List all the values that the variable num contains through the iterations of the following for loop: 
for num in range(2, 9, 2): 
a. 2, 3, 4, 5, 6, 7, 8, 9 
b. 2, 5, 8 
c. 2, 4, 6, 8 
d. 1, 3, 5, 7, 9 
e. 2 
Q5. How to load the contents of the random module into memory? 
a. random 
b. import random 
c. load random 
d. download random 
e. none of the above 
Q6. For myString = [["1","a"],0,[""]], what is the output of the following line: 
myString[0][0][0] 
a. 0 
b. 1 
c. a 
d. ["1","a"] 
e. [["1","a"],0,[""]] 
f. [['1', 'a'], 0] 
Q7. For myString = [["1","a"],0,[""]], what is the output of the following line: 
myString[0][1]+myString[2][0] 
a. 0 
b. 1 
c. a 
d. ["1","a"] 
e. [["1","a"],0,[""]] 
f. [['1', 'a'], 0] 
Q8. For myString = [["1","a"],0,[""]], what is the output of the following line: 
myString[0:1]+myString[1:2] 
a. 0 
b. 1 
c. a 
d. ["1","a"] 
e. [["1","a"],0,[""]] 
f. [['1', 'a'], 0] 
Q9. For myString = [["1","a"],0,[""]], what is the output of the following line: 
myString[int(myString[0][0])] 
a. 0 
b. 1 
c. a 
d. ["1","a"] 
e. [["1","a"],0,[""]] 
f. [['1', 'a'], 0] 
Q10. class Dog: 
 def __init__(self, name, age): 
 self.name = name 
 self.age = age 
The correct way to instantiate the above Dog class is: 
a. Dog.create("Rufus", 3) 
b. Dog() 
c. Dog("Rufus", 3) 
d. Dog.__init__("Rufus", 3) 
这些词算编程里的基础词语吧   
 
 
 |   
 
 
 
 |