一般的な自動テストスクリプト - ランダムに生成された電話番号

#のコード:UTF-8 

随机生成手机号码
インポートランダム
 から文字列インポート


DEF createPhoneNumber():
    prelist = [ " 130 "" 131 "" 132 "" 133 "" 134 "" 135 "" 136 " " 137 " " 138 " "139 "" 147 "" 150 " " 151 "" 152 "" 153 "" 155 "" 156 "" 157 "" 158 "" 159 "" 186 "" 187 "" 188 "]
     戻りrandom.choice(prelist)+ ""(レンジ(8)におけるiに対する0123456789 ")random.choice().join" 
    戻り random.choice(prelist)+ '' .join(random.sample(桁、8 ) )


もし __name__ == ' __main__ ' プリント(createPhoneNumber())

 

おすすめ

転載: www.cnblogs.com/chenri/p/11365742.html