Python
python的一些内容
刺无名客
有趣
展开
-
Numpy100题系列(1-50更新中)
题目项目来源:点我1.Import the numpy package under the name np (★☆☆) 导入numpy为npimport numpy as np2. Print the numpy version and the configuration (★☆☆) 打印numpy的版本和配置信息import numpy as npprint(np.__versio...原创 2020-05-06 17:01:32 · 633 阅读 · 0 评论 -
Python 爬虫 1. 当当TOP的爬取
# coding=utf-8import requestsimport redef get_request(url): try: response=requests.get(url) if response.status_code == 200: return response.text except request...原创 2020-04-14 01:56:20 · 1410 阅读 · 0 评论 -
利用map和reduce编写一个str2float函数,把字符串'123.456'转换成浮点数123.456:
题目:利用map和reduce编写一个str2float函数,把字符串'123.456'转换成浮点数123.456:来源:廖雪峰Python上的练习题思路定位小数点,分割小数部分和整数部分,使用reduce和map函数分别将字符串转换成数字,除以小数点位数在相加即可# -*- coding: utf-8 -*-from functools import reduced...原创 2019-07-29 19:27:54 · 1446 阅读 · 1 评论