Python常用函数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python常用函数相关的知识,希望对你有一定的参考价值。

1.Python choice() 函数

import random

print "choice([1, 2, 3, 5, 9]) : ", random.choice([1, 2, 3, 5, 9])
print "choice(‘A String‘) : ", random.choice(A String)

输出结果

choice([1, 2, 3, 5, 9]) :  2
choice(A String) :  n

 

以上是关于Python常用函数的主要内容,如果未能解决你的问题,请参考以下文章