你究竟能用Python做什么?

article/2025/8/22 17:14:57

 

中英文模式阅读 中文模式阅读 英文模式阅读

What exactly can you do with Python? Here are Python's 3 main applications.

你究竟能用Python做什么?这是Python的3个主要应用。

If you're thinking of learning Python --- or if you recently started learning it --- you may be asking yourself:
如果您正在考虑学习Python ---或者如果您最近开始学习它 - 您可能会问自己:

"What exactly can I use Python for?"

Well that's a tricky question to answer, because there are so many applications for Python.
嗯,这是一个棘手的问题,因为Python有很多应用。

But over time, I have observed that there are 3 main popular applications for Python:
但随着时间的推移,我发现Python有三个主要的流行应用:

  • Web Development
  • Data Science --- including machine learning, data analysis, and data visualization
  • Scripting

Let's talk about each of them in turn.
让我们依次谈谈它们中的每一个。

Web Development

Web frameworks that are based on Python like
基于Python的Web框架 Django and
and Flask have recently become very popular for web development.
最近变得非常流行的Web开发。

These web frameworks help you create server-side code (backend code) in Python. That's the code that runs on your server, as opposed to on users' devices and browsers (front-end code). If you're not familiar with the difference between backend code and front-end code, please see my footnote below.
这些Web框架可帮助您在Python中创建服务器端代码(后端代码)。这是在您的服务器上运行的代码,而不是用户的设备和浏览器(前端代码)。如果您不熟悉后端代码和前端代码之间的区别,请参阅下面的脚注。

But wait, why do I need a web framework?

That's because a web framework makes it easier to build common backend logic. This includes mapping different URLs to chunks of Python code, dealing with databases, and generating HTML files users see on their browsers.
这是因为Web框架使构建通用后端逻辑变得更容易。这包括将不同的URL映射到Python代码块,处理数据库以及生成用户在其浏览器上看到的HTML文件。

Which Python web framework should I use?

Django and Flask are two of the most popular Python web frameworks. I'd recommend using one of them if you're just getting started.
Django和Flask是两个最流行的Python Web框架。如果你刚入门,我建议你使用其中一个。

What's the difference between Django and Flask?

There's an
There's an excellent article about this topic by Gareth Dwyer, so let me quote it here:
关于Gareth Dwyer的这个话题,让我在这里引用它:

<begin quote>

Main contrasts:
Main contrasts:

  • Flask provides simplicity, flexibility and fine-grained control. It is unopinionated (it lets you decide how you want to implement things).
  • Django provides an all-inclusive experience: you get an admin panel, database interfaces, an ORM [object-relational mapping], and directory structure for your apps and projects out of the box.

You should probably choose:
你应该选择:

  • Flask, if you're focused on the experience and learning opportunities, or if you want more control about which components to use (such as what databases you want to use and how you want to interact with them).
  • Django, if you're focused on the final product. Especially if you're working on a straight-forward application such as a news site, an e-store, or blog, and you want there to always be a single, obvious way of doing things.

</end quote>

In other words, If you're a beginner, Flask is probably a better choice because it has fewer components to deal with. Also, Flask is a better choice if you want more customization.
换句话说,如果你是初学者,Flask可能是一个更好的选择,因为它有更少的组件需要处理。此外,如果您想要更多自定义,Flask是更好的选择。

On the other hand, if you're looking to build something straight-forward, Django will probably let you get there faster.
另一方面,如果你想要直接构建一些东西,Django可能会让你更快地到达那里。

Now, if you're looking to learn Django, I recommend the book called Django for Beginners. You can find it
现在,如果你想学习Django,我推荐名为Django for Beginners的书。你可以找到它here.
.

You can also find the free sample chapters of that book
您还可以找到该书的免费样本章节here.
.

Okay, let's go to the next topic!
好的,我们来看下一个主题吧!

Data Science --- including machine learning, data analysis, and data visualization

First of all, let's review what machine learning is .

I think the best way to explain what machine learning is would be to give you a simple example.
我认为解释机器学习的最佳方法是给你一个简单的例子。

Let's say you want to develop a program that automatically detects what's in a picture.
假设您想要开发一个程序来自动检测图片中的内容。

So, given this picture below (Picture 1), you want your program to recognize that it's a dog.
因此,如下图(图1),您希望程序识别出它是一只狗。

Given this other one below (Picture 2), you want your program to recognize that it's a table.

鉴于下面的另一个(图2),您希望程序识别它是一个桌子。

You might say, well, I can just write some code to do that. For example, maybe if there are a lot of light brown pixels in the picture, then we can say that it's a dog.
你可能会说,好吧,我可以写一些代码来做到这一点。例如,如果图片中有很多浅棕色像素,那么我们可以说它是一只狗。

Or maybe, you can figure out how to detect edges in a picture. Then, you might say, if there are many straight edges, then it's a table.
或者,您可以弄清楚如何检测图片中的边缘。然后,你可能会说,如果有很多直边,那么它就是一张桌子。

However, this kind of approach gets tricky pretty quickly. What if there's a white dog in the picture with no brown hair? What if the picture shows only the round parts of the table?
但是,这种方法很快变得棘手。如果照片中有一只没有棕色头发的白狗怎么办?如果图片只显示表格的圆形部分怎么办?

This is where machine learning comes in.

Machine learning typically implements an algorithm that automatically detects a pattern in the given input.
机器学习通常实现一种自动检测给定输入中的模式的算法。

You can give, say, 1,000 pictures of a dog and 1,000 pictures of a table to a machine learning algorithm. Then, it will learn the difference between a dog and a table. When you give it a new picture of either a dog or a table, it will be able to recognize which one it is.
你可以给机器学习算法给1000张狗的照片和1000张桌子的照片。然后,它将学习狗和桌子之间的区别。当你给它一张狗或桌子的新图片时,它将能够识别它是哪一个。

I think this is somewhat similar to how a baby learns new things. How does a baby learn that one thing looks like a dog and another a table? Probably from a bunch of examples.
我认为这有点类似于婴儿学习新事物的方式。宝宝怎么知道一件事看起来像狗,另一件看起来像一张桌子?可能来自一堆例子。

You probably don't explicitly tell a baby, "If something is furry and has light brown hair, then it's probably a dog."
你可能没有明确地告诉婴儿,"如果有毛茸茸的东西,有浅棕色的头发,那么它可能是一只狗。"

You would probably just say, "That's a dog. This is also a dog. And this one is a table. That one is also a table."
你可能会说,"那只狗是狗。这也是一只狗。这只是一张桌子。那张桌子也是一张桌子。"

Machine learning algorithms work much the same way.
机器学习算法的工作方式大致相同。

You can apply the same idea to:
您可以将相同的想法应用于:

  • recommendation systems (think YouTube, Amazon, and Netflix)
  • face recognition
  • voice recognition

among other applications.
等应用程序。

Popular machine learning algorithms you might have heard about include:
您可能听说过的流行机器学习算法包括:

  • Neural networks
  • Deep learning
  • Support vector machines
  • Random forest

You can use any of the above algorithms to solve the picture-labeling problem I explained earlier.
您可以使用上述任何算法来解决我之前解释过的图片标注问题。

Python for machine learning

There are popular machine learning libraries and frameworks for Python.
有流行的机器学习库和Python框架。

Two of the most popular ones are
两个最受欢迎的是 scikit-learn and
and TensorFlow .
.

  • scikit-learn comes with some of the more popular machine learning algorithms built-in. I mentioned some of them above.
  • TensorFlow is more of a low-level library that allows you to build custom machine learning algorithms.

If you're just getting started with a machine learning project, I would recommend that you first start with scikit-learn. If you start running into efficiency issues, then I would start looking into TensorFlow.
如果您刚开始使用机器学习项目,我建议您先从scikit-learn开始。如果你开始遇到效率问题,那么我会开始研究TensorFlow。

How should I learn machine learning?

To learn machine learning fundamentals, I would recommend either
要学习机器学习基础知识,我建议Stanford's or
or Caltech's machine learning course.
机器学习课程。

Please note that you need basic knowledge of calculus and linear algebra to understand some of the materials in those courses.
请注意,您需要微积分和线性代数的基本知识才能理解这些课程中的一些材料。

Then, I would practice what you've learned from one of those courses with
然后,我会练习你从其中一门课程中学到的东西Kaggle. It's a website where people compete to build the best machine learning algorithm for a given problem. They have nice tutorials for beginners, too.
。这是一个人们竞争为特定问题构建最佳机器学习算法的网站。他们也为初学者提供了很好的教程。

What about data analysis and data visualization?

To help you understand what these might look like, let me give you a simple example here.
为了帮助您了解这些可能是什么样子,让我在这里给您一个简单的例子。

Let's say you're working for a company that sells some products online.
假设您正在为一家在线销售某些产品的公司工作。

Then, as a data analyst, you might draw a bar graph like this.
然后,作为数据分析师,您可以绘制这样的条形图。


Bar Chart 1 --- generated with Python
条形图1 ---用Python生成

From this graph, we can tell that men bought over 400 units of this product and women bought about 350 units of this product this particular Sunday.
从这张图中,我们可以看出,男性购买了超过400个单位的产品,女性在这个特定的星期天购买了约350个单位的产品。

As a data analyst, you might come up with a few possible explanations for this difference.
作为数据分析师,您可能会对这种差异提出一些可能的解释。

One obvious possible explanation is that this product is more popular with men than with women. Another possible explanation might be that the sample size is too small and this difference was caused just by chance. And yet another possible explanation might be that men tend to buy this product more only on Sunday for some reason.
一个明显可能的解释是,这种产品比男性更受男性欢迎。另一种可能的解释可能是样本量太小而且这种差异只是偶然造成的。而另一种可能的解释可能是,男性倾向于仅在周日因某种原因购买该产品。

To understand which of these explanations is correct, you might draw another graph like this one.
要了解哪些解释是正确的,您可能会绘制另一个这样的图表。


Line Chart 1 --- generated with Python
折线图1 ---用Python生成


Instead of showing the data for Sunday only, we're looking at the data for a full week. As you can see, from this graph, we can see that this difference is pretty consistent over different days.
我们不是仅显示星期日的数据,而是查看整整一周的数据。如您所见,从这张图中,我们可以看到这种差异在不同的日子里非常一致。

From this little analysis, you might conclude that the most convincing explanation for this difference is that this product is simply more popular with men than with women.
从这个小小的分析中,你可以得出结论,对这种差异最有说服力的解释是,这种产品更容易受到男性的欢迎,而不是女性。

On the other hand, what if you see a graph like this one instead?
另一方面,如果你看到像这样的图表怎么办?


Line Chart 2 --- also generated with Python
折线图2 ---也是用Python生成的

Then, what explains the difference on Sunday?
那么,是什么解释了周日的差异?

You might say, perhaps men tend to buy more of this product only on Sunday for some reason. Or, perhaps it was just a coincidence that men bought more of it on Sunday.
你可能会说,也许男人往往只是因为某种原因在周日购买更多的这种产品。或者,也许只是巧合,周日男人买了更多。

So, this is a simplified example of what data analysis might look like in the real world.
因此,这是数据分析在现实世界中可能看起来像的简化示例。

The data analysis work I did when I was working at Google and Microsoft was very similar to this example --- only more complex. I actually used Python at Google for this kind of analysis, while I used JavaScript at Microsoft.
我在谷歌和微软工作时所做的数据分析工作与这个例子非常相似 - 只是更复杂。我实际上在谷歌使用Python进行这种分析,而我在微软使用JavaScript。

I used SQL at both of those companies to pull data from our databases. Then, I would use either Python and Matplotlib (at Google) or JavaScript and D3.js (at Microsoft) to visualize and analyze this data.
我在这两家公司使用SQL来从我们的数据库中提取数据。然后,我会使用Python和Matplotlib(在谷歌)或JavaScript和D3.js(在微软)来可视化和分析这些数据。

Data analysis / visualization with Python

One of the most popular libraries for data visualization is
最受欢迎的数据可视化库之一是Matplotlib.
.

It's a good library to get started with because:
这是一个很好的库,因为:

  • It's easy to get started with
  • Some other libraries such as seaborn is based on it. So, learning Matplotlib will help you learn these other libraries later on.

How should I learn data analysis / visualization with Python?

You should first learn the fundamentals of data analysis and visualization. When I looked for good resources for this online, I couldn't find any. So, I ended up making a YouTube video on this topic:
您应该首先了解数据分析和可视化的基础知识。当我在网上寻找好的资源时,我找不到任何东西。所以,我最终制作了关于这个主题的YouTube视频:


Intro to Data Analysis / Visualization with Python and Matplotlib
使用Python和Matplotlib介绍数据分析/可视化

I also ended up making a
我也最终做了一个full course on this topic on Pluralsight, which you can take for free by signing up to their 10-day free trial.
,您可以免费注册10天免费试用版。

I'd recommend both of them.
我推荐他们两个。

After learning the fundamentals of data analysis and visualization, learning fundamentals of statistics from websites like Coursera and Khan Academy will be helpful, as well.
在学习了数据分析和可视化的基础知识之后,从Coursera和Khan Academy等网站学习统计数据的基础知识也会有所帮助。

Scripting

What is scripting?

Scripting usually refers to writing small programs that are designed to automate simple tasks.
脚本通常是指编写旨在自动执行简单任务的小程序。

So, let me give you an example from my personal experience here.
那么,让我举一个我个人经历的例子。

I used to work at a small startup in Japan where we had an email support system. It was a system for us to respond to questions customers sent us via email.
我曾经在日本的一家小型创业公司工作,我们有一个电子邮件支持系统。这是一个系统,让我们回答客户通过电子邮件发送给我们的问题。

When I was working there, I had the task of counting the numbers of emails containing certain keywords so we could analyze the emails we received.
当我在那里工作时,我的任务是计算包含某些关键字的电子邮件的数量,以便我们分析收到的电子邮件。

We could have done it manually, but instead, I wrote a simple program / simple script to automate this task.
我们可以手动完成它,但是,我编写了一个简单的程序/简单脚本来自动执行此任务。

Actually, we used Ruby for this back then, but Python is also a good language for this kind of task. Python is suited for this type of task mainly because it has relatively simple syntax and is easy to write. It's also quick to write something small with it and test it.
实际上,我们当时使用Ruby,但Python也是这类任务的好语言。 Python适合这种类型的任务,主要是因为它具有相对简单的语法并且易于编写。用它写一些小东西并测试它也很快。

What about embedded applications?

I'm not an expert on embedded applications, but I know that Python works with Rasberry Pi. It seems like a popular application among hardware hobbyists.
我不是嵌入式应用程序方面的专家,但我知道Python可以与Rasberry Pi一起使用。它似乎是硬件爱好者中的一种流行应用。

What about gaming?

You could use the library called PyGame to develop games, but it's not the most popular gaming engine out there. You could use it to build a hobby project, but I personally wouldn't choose it if you're serious about game development.
您可以使用名为PyGame的库来开发游戏,但它并不是最流行的游戏引擎。你可以用它来建立一个爱好项目,但如果你认真对待游戏开发,我个人不会选择它。

Rather, I would recommend getting started with Unity with C#, which is one of the most popular gaming engines. It allows you to build a game for many platforms, including Mac, Windows, iOS, and Android.
相反,我建议开始使用Unity与C#,这是最受欢迎的游戏引擎之一。它允许您为许多平台构建游戏,包括Mac,Windows,iOS和Android。

What about desktop applications?

You could make one with Python using Tkinter, but it doesn't seem like the most popular choice either.
您可以使用Tkinter制作一个Python,但它似乎也不是最受欢迎的选择。

Instead, it seems like languages like
相反,它似乎像语言Java, C#, and C++ are more popular for this.
对此更受欢迎。

Recently, some companies have started using JavaScript to create Desktop applications, too.
最近,一些公司也开始使用JavaScript来创建桌面应用程序。

For example, Slack's desktop app was built with something called Electron. It allows you to build desktop applications with JavaScript.
。它允许您使用JavaScript构建桌面应用程序。

Personally, if I was building a desktop application, I would go with a JavaScript option. It allows you to reuse some of the code from a web version if you have it.
就个人而言,如果我正在构建一个桌面应用程序,我会使用JavaScript选项。它允许您重用Web版本中的一些代码(如果有的话)。

However, I'm not an expert on desktop applications either, so please let me know in a comment if you disagree or agree with me on this.
但是,我也不是桌面应用程序的专家,所以如果您不同意或同意我的意见,请在评论中告诉我。

Python 3 or Python 2?

I would recommend Python 3 since it's more modern and it's a more popular option at this point.
我会推荐Python 3,因为它更现代,而且在这一点上它是一个更受欢迎的选项。

Footnote: A note about back-end code vs front-end code (just in case you are not familiar with the terms):

Let's say you want to make something like Instagram.
假设您想制作像Instagram这样的东西。

Then, you'd need to create front-end code for each type of device you want to support.
然后,您需要为要支持的每种类型的设备创建前端代码。

You might use, for example:
您可以使用,例如:

  • Swift for iOS
  • Java for Android
  • JavaScript for web browsers

Each set of code will run on each type of device / browser. This will be the set of code that determines what the layout of the app will be like, what the buttons should look like when you click them, etc.
每组代码都将在每种类型的设备/浏览器上运行。这将是一组代码,用于确定应用程序的布局如何,单击按钮时的外观等等。

However, you will still need the ability to store users' info and photos. You will want to store them on your server and not just on your users' devices so each user's followers can view his/her photos.
但是,您仍然需要能够存储用户的信息和照片。您需要将它们存储在服务器上,而不仅仅存储在用户的设备上,以便每个用户的关注者都可以查看他/她的照片。

This is where the backend code / server-side code comes in. You'll need to write some backend code to do things like:
这是后端代码/服务器端代码的用武之地。您需要编写一些后端代码来执行以下操作:

  • Keep track of who's following who
  • Compress photos so they don't take up so much storage space
  • Recommend photos and new accounts to each user in the discovery feature

So, this is the difference between backend code and front-end code.
因此,这是后端代码和前端代码之间的区别。

By the way, Python is not the only good choice for writing backend / server-side code. There are many other popular choices, including Node.js, which is based on JavaScript.
顺便说一下,Python并不是编写后端/服务器端代码的唯一好选择。还有许多其他流行的选择,包括Node.js,它基于JavaScript。

Anyway, thanks a lot for reading my article!

  • Python
  • Data Visualization
  • Data Science
  • Web Development
  • Programming 38K claps

中英文模式阅读
中文模式阅读
英文模式阅读

查看英文原文

查看更多文章

公众号:银河系1号

联系邮箱:public@space-explore.com

(未经同意,请勿转载)


http://chatgpt.dhexx.cn/article/a3K1cZPt.shtml

相关文章

用Python做图像处理

用Python做图像处理 最近在做一件比较 evil 的事情——验证码识别&#xff0c;以此来学习一些新的技能。因为我是初学&#xff0c;对图像处理方面就不太了解了&#xff0c;欲要利吾事&#xff0c;必先利吾器&#xff0c;既然只是做一下实验&#xff0c;那用 Python 来作原型开发…

python都能做什么

前言 一、python&#xff1a; Python具有丰富和强大的库。它常被昵称为胶水语言&#xff0c;能够把用其他语言制作的各种模块&#xff08;尤其是C/C&#xff09;很轻松地联结在一起。常见的一种应用情形是&#xff0c;使用Python快速生成程序的原型&#xff08;有时甚至是程序…

你都用 Python 来做什么?

你们都用python做些什么呢&#xff1f; 在开发中 python 这一个语言就像是小叮当&#xff0c;而 python 的第三方库则是“百宝箱”&#xff0c;你只要想着对某一个方向进行开发&#xff0c;那么这个“百宝箱”就会给你想要的东西。 由于我是在开发多年后接触到的 python&#…

怎样利用python做一个软件,python可以自己做软件吗

python能做什么软件&#xff1f; 主要可以做小程序&#xff0c;爬虫程序&#xff0c;用于系统编程等等还是很广泛的。Python 的应用领域分为下面几类。下文将介绍一些Python 具体能帮我们做的事情。 但我们不会对各个工具进行深入探讨&#xff0c;如果你对这些话题感兴趣&…

python可以做什么工作-python都能干什么用

一、Python可以做什么&#xff1f; 1、数据库&#xff1a;Python在数据库方面很优秀&#xff0c;可以和多种数据库进行连接&#xff0c;进行数据处理&#xff0c;从商业型的数据库到开放源码的数据库都提供支持。例如&#xff1a;Oracle, My SQL Server等等。有多种接口可以与…

学了python能干啥举例-Python主要用来做什么?

Python主要用来做什么&#xff1f;Python可以做web应用开发、网络爬虫、AI人工智能与机器学习、处理数据用来分析、数据科学&#xff1a;包括机器学习、数据分析和数据可视化、脚本等方面开发。 Python用来开发的有&#xff1a; 1、做Web应用开发 在国内豆瓣一开始就使用Pyth…

python怎么算列表的平方_总算明了python如何求平方

总算明了python如何求平方 日期:2019-08-25 12:22:17 浏览:341 核心提示:打开电脑上的计算器一看,居然没法求平方,是不是就没办法了呢?用python就可以啦,那么python如何求平方呢?一起来了解下吧: python如何求平方 1.计算乘方 pow(4,3) #结果64 2.计算平方 import…

Python 计算平方根

Python 计算平方根 文章目录 Python 计算平方根平方根封装为函数相关博客 平方根 平方根&#xff0c;又叫二次方根&#xff0c;表示为〔√&#xffe3;〕&#xff0c;一个正数有两个实平方根&#xff0c;它们互为相反数&#xff0c;负数没有平方根&#xff0c;0的平方根是0 …

python中平方_python里平方

广告关闭 腾讯云11.11云上盛惠 &#xff0c;精选热门产品助力上云&#xff0c;云服务器首年88元起&#xff0c;买的越多返的越多&#xff0c;最高返5000元&#xff01; 我正在写一个函数&#xff0c;它将返回一个平方数列表&#xff0c;但如果该函数使用参数&#xff08;appl…

python平方和计算技巧,python平方和计算技巧 Python算法练习题:四平方和

全栈记事交流群内一个同学的问题&#xff0c;正好收集一下解决方案&#xff1b; 四平方和的定理又称拉格朗日定理&#xff1a;每个正整数都可以表示至多4个正整数的平方和。如果把0包括进去&#xff0c;就可以表示为4个数的平方和。 比如&#xff1a; 50^20^21^22^2 71^21^21^2…

python中平方根_如何在Python中找到平方根

python中平方根 Hello everyone, in this tutorial, I’ll show 3 ways to find square root in Python. 大家好,在本教程中,我将展示3种在Python中找到平方根的方法。 Let’s see how to do it. 让我们来看看如何做。 1. Using Exponent 1.使用指数 number = int(input(&…

python编程a的x次方_python平方-Python,平方

本教程分享&#xff1a;《python平方》&#xff0c;Python是一种跨平台的计算机程序设计语言。是一种面向对象的动态类型语言&#xff0c;最初被设计用于编写自动化脚本(shell)&#xff0c;随着版本的不断更新和语言新功能的添加&#xff0c;越来越多被用于独立的、大型项目的开…

python里的平方_python中平方和

广告关闭 腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元! 为什么python给出了“错误”的答案? x= 16 sqrt= x**(.5)returns 4 sqrt= x**(12)returns 1... 方法一:使用内置模块>>> import math >>> …

python平方数_python数字平方

广告关闭 腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元! 还是要强调一下python的变量和数据类型的关系,变量只是对某个对象的引用或者说代号、名字、调用等等,变量本身没有数据类型的概念 。 只有1,hello这一类对象…

python中平方_python中平方

广告关闭 腾讯云11.11云上盛惠 &#xff0c;精选热门产品助力上云&#xff0c;云服务器首年88元起&#xff0c;买的越多返的越多&#xff0c;最高返5000元&#xff01; 为什么python给出了“错误”的答案&#xff1f; x 16 sqrt x**(.5)returns 4 sqrt x**(12)returns 1... …

python开平方根_python里开平方

广告关闭 腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元! 所以忍不住分享一下给大家。 点这里https:www.cbedai.netialexanderi可以跳转到教程。 1,开平方python数字sqrt()函数返回x的平方根(x > 0)。 语法以下是sq…

python里的平方_python中的平方

广告关闭 腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元! 为什么python给出了“错误”的答案? x= 16 sqrt= x**(.5)returns 4 sqrt= x**(12)returns 1... 猜测一个要求数字的平方根 2. 用 原数 猜测数字 3. 用 计算步…

python中平方怎么表示_python表示平方

广告关闭 腾讯云11.11云上盛惠 ,精选热门产品助力上云,云服务器首年88元起,买的越多返的越多,最高返5000元! 我正在写一个函数,它将返回一个平方数列表,但如果该函数使用参数(apple)或(range(10))或列表将返回一个空列表。 我不知道如何返回空集如果参数n不是一…

chatgpt赋能python:Python怎么开平方?——用Python进行数学运算

Python怎么开平方&#xff1f;——用Python进行数学运算 在数学计算中&#xff0c;开平方是一项常见的运算&#xff0c;而在Python编程中&#xff0c;我们同样需要经常进行这类运算。下面介绍几种Python开平方的方法。 1. 使用math库的sqrt函数开平方 Python自带的math库中有…

高效下载论文----谷歌SCI-HUB插件

1 谷歌商店添加SCI-HUB插件 论文下载神器SCI-HUB&#xff0c;使用浏览器插件后&#xff0c;论文下载效率进一步提高。如图所示&#xff0c;谷歌商店搜索插件&#xff1a; 添加插件&#xff0c;如图所示&#xff1a; 点击Add extension&#xff1a; 2 选择代理通道 图中黄色或…