National Computer Rank Examination two (Python Programming Language) Classic title

1, using the library turtle turtle.fd () function and turtle.seth () function to draw a square side length of 200.

import turtle as t

d = 0

for i in range(4):
    t.fd(200)
    d += 90
    t.seth(d)

 

2, using only the basic syntax of Python, Python programs written results following mathematical expression and outputs, the decimal point three.

 

3, using the word jieba library, please complete the following procedures.

Import jieba 

S = " socialism with Chinese characteristics into a new era, the principal contradiction in our society has been transformed contradiction between the inadequate development of a better life for the people and the growing imbalance of " 

the n- = len (S) 
m = jieba.lcut ( S, cut_all = False)
 Print ( " Chinese characters as {}, the number of Chinese words as {}. " .format (n-, m))

 

Guess you like

Origin www.cnblogs.com/liuzhiqaingxyz/p/11402898.html