摘要:
import random heads = 0 for i in range(1, 1001): if random.randint(0, 1) == 1: heads = heads + 1 if i == 500: print('Halfway done!') print('Heads came up ' + str(heads) + ' ti... 阅读全文
posted @ 2019-03-13 16:15
晨光曦微
阅读(160)
评论(0)
推荐(0)
摘要:
##小程序,计算一个字符串中每个字符出现的次数+ import pprint message = 'It was a bright cold day in April, and the clocks were striking thirteen.' count = {} for character in message: count.setdefault(character, 0) ... 阅读全文
posted @ 2019-03-13 16:14
晨光曦微
阅读(716)
评论(0)
推荐(0)
摘要:
''' picnicItems 野餐用品清单 picnicItems sandwiches.................... 4apples........................ 12cups.......................... 4cookies........... 阅读全文
posted @ 2019-03-13 16:13
晨光曦微
阅读(259)
评论(0)
推荐(0)
摘要:
def boxPrint(symbol, width, height): if len(symbol) != 1: raise Exception('Symbol(符号) must be a single character string.') if width <= 2: raise Exception('Width must be greate... 阅读全文
posted @ 2019-03-13 16:12
晨光曦微
阅读(354)
评论(0)
推荐(0)
摘要:
birthdays = {'Alice': 'Apr 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'} while True: print('Enter a name: (blank to quit)') name = input() if name == '': break if name in birthdays: ... 阅读全文
posted @ 2019-03-13 16:09
晨光曦微
阅读(271)
评论(0)
推荐(0)
该文被密码保护。 阅读全文
posted @ 2019-03-13 16:06
晨光曦微
阅读(2)
评论(0)
推荐(0)
摘要:
import requests from pyquery import PyQuery as pq url='http://www.51xxx.com/Try/index/p/3' headers={ 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chro... 阅读全文
posted @ 2019-03-13 16:03
晨光曦微
阅读(736)
评论(0)
推荐(0)
摘要:
A.右键.py文件,edit with idle B.如果没有这个选项: 选择打开方式,进入python安装路径,选择 Python37\Lib\idlelib\idle.bat 阅读全文
posted @ 2019-03-13 15:56
晨光曦微
阅读(5880)
评论(3)
推荐(2)
摘要:
''' 【生产者】正在生产 1 中......【消费者】正在消费 1 中...【生产者】消费者返回了:OK,完成消费!! !【生产者】正在生产 2 中......【消费者】正在消费 2 中...【生产者】消费者返回了:OK,完成消费!! !【生产者】正在生产 3 中......【消费者】正在消费 3 阅读全文
posted @ 2019-03-13 15:35
晨光曦微
阅读(314)
评论(0)
推荐(0)

浙公网安备 33010602011771号