程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Wuhan University of technology Python Program Design Chapter 5 test

編輯:Python

s.count(x) The return value of :

B. character string s in x The number of

Used to return a string s The function of the length of is :

B.len(s)

User input 0-100 Between the percentile scores , Turn it into a five point output , The correct answer below is :
C

score = float(input())
degree = “EEEEEEDCBAA”
score_five =degree[int(score // 10)]
print(score_five)

When traversing a file object , Which of the following methods can be used to remove line breaks at the end of a line :

B.s.strip()

s = “Hello world”
print(“{:5}”.format(s))
The run result of is :

C.Hello world

​num = 3.00001284
print(“{:.3f}”.format(num))
The output of the running result is :

B.3.000

print(“Hello”)
print(“Hello\n”)
Run these two statements , The correct choice below is

C. The last statement outputs one more blank line

python in random In the library , Methods that can generate integer random numbers are :

A.randint()


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved