🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
``` from random import randint times = eval(input("请输入试验次数:")) get_car_without_change = 0 get_car_with_change = 0 for i in range(times): doors =['thing','thing','thing'] car_id = randint(0,2) doors[car_id] = 'car' my_choice = randint(0,2) if my_choice == car_id: get_car_without_change += 1 if my_choice != car_id: get_car_with_change += 1 P_change = get_car_with_change/times P_Not_change = get_car_without_change/times print(P_change) print(P_Not_change) ``` ``` a = 'f' d =1 c = ' ' e = 'abcv 中文' b = e.isalpha() print(b) new ='' for i in e: print(i.isalpha()) if(i.isalpha()): new +=i else: print(i) print(new) ```