Python three-digit daffodil number (with zero basic learning materials)

foreword

So go straight to the code:

# python输入一个水仙花数(三位数) 输出百位十位个位
"""
从控制台输入一个三位数num,
如果是水仙花数就打印num是水仙花数,
否则打印num不是水仙花数
"""
"""
任务:
1、定义变量num用于存放用户输入的数值
2、定义变量gw、sw、bw分别用于存放输入的三位数的个位,十位,百位
3、定义变量total,用于存放各位数字立方和
4、用if语句判断各位数字立方和是否等于该本身
5、符合条件输出num是水仙花数,反之输出num不是水仙花数
"""
"""
任务提示

1、"水仙花数"是指一个三位数,其各位数字立方和等于该本身。
 例如:输入153,因为153=1^3+5^3+3^3,所以153是一个水仙花数。
"""
num = int(input("请输入一个三位数:"))
# print('%s*10^2+%s*10+%s' % (num[0], num[1], num[2]))
gw = num%10
sw = (num/10)%10
bw = num/100
total = gw*gw*gw + sw*sw*sw + bw*bw*bw
if( total == num):
  print("是水仙花数")
else:
  print("不是水仙花数")

"""
"""
shuixianhua=[]
for i in range(1,10):
 for j in range(10):
 for k in range(10):
  if i*i*i + j*j*j + k*k*k == 100*i + 10*j + k:
  shuixianhua.append(100*i + 10*j + k)
for i in shuixianhua:
 if i == shuixianhua[-1]:
 print(i)
 else:
 print(i, end = ',')

operation result:

insert image description here

Python finds the value of a three-digit ones, tens, and hundreds

define a three-digit

a = 123456789

Hundreds digit: a//100%10

Tens digit: a//10%10

Single digit: a//1%10

Take the penultimate digit, which is a//digit%10

Finally, I will introduce a complete python learning route, from entry to advanced, including mind maps, classic books, and supporting videos, to help those who want to learn python and data analysis!

1. Introduction to Python

The following content is the basic knowledge necessary for all application directions of Python. If you want to do crawlers, data analysis or artificial intelligence, you must learn them first. Anything tall is built on primitive foundations. With a solid foundation, the road ahead will be more stable.

Include:

Computer Basics

insert image description here

python basics

insert image description here

Python introductory video 600 episodes:

Watching the zero-based learning video is the fastest and most effective way to learn. Following the teacher's ideas in the video, it is still very easy to get started from the basics to the in-depth.

2. Python crawler

As a popular direction, reptiles are a good choice whether it is a part-time job or as an auxiliary skill to improve work efficiency.

Relevant content can be collected through crawler technology, analyzed and deleted to get the information we really need.

This information collection, analysis and integration work can be applied in a wide range of fields. Whether it is life services, travel, financial investment, product market demand of various manufacturing industries, etc., crawler technology can be used to obtain more accurate and effective information. use.

insert image description here

Python crawler video material

insert image description here

3. Data analysis

According to the report "Digital Transformation of China's Economy: Talents and Employment" released by the School of Economics and Management of Tsinghua University, the gap in data analysis talents is expected to reach 2.3 million in 2025.

With such a big talent gap, data analysis is like a vast blue ocean! A starting salary of 10K is really commonplace.

insert image description here

4. Database and ETL data warehouse

Enterprises need to regularly transfer cold data from the business database and store it in a warehouse dedicated to storing historical data. Each department can provide unified data services based on its own business characteristics. This warehouse is a data warehouse.

The traditional data warehouse integration processing architecture is ETL, using the capabilities of the ETL platform, E = extract data from the source database, L = clean the data (data that does not conform to the rules), transform (different dimension and different granularity of the table according to business needs) calculation of different business rules), T = load the processed tables to the data warehouse incrementally, in full, and at different times.

insert image description here

5. Machine Learning

Machine learning is to learn part of the computer data, and then predict and judge other data.

At its core, machine learning is "using algorithms to parse data, learn from it, and then make decisions or predictions about new data." That is to say, a computer uses the obtained data to obtain a certain model, and then uses this model to make predictions. This process is somewhat similar to the human learning process. For example, people can predict new problems after obtaining certain experience.

insert image description here

Machine Learning Materials:

insert image description here

6. Advanced Python

From basic grammatical content, to a lot of in-depth advanced knowledge points, to understand programming language design, after learning here, you basically understand all the knowledge points from python entry to advanced.

insert image description here

At this point, you can basically meet the employment requirements of the company. If you still don’t know where to find interview materials and resume templates, I have also compiled a copy for you. It can really be said to be a systematic learning route for nanny and .

insert image description here
But learning programming is not achieved overnight, but requires long-term persistence and training. In organizing this learning route, I hope to make progress together with everyone, and I can review some technical points myself. Whether you are a novice in programming or an experienced programmer who needs to be advanced, I believe that everyone can gain something from it.

It can be achieved overnight, but requires long-term persistence and training. In organizing this learning route, I hope to make progress together with everyone, and I can review some technical points myself. Whether you are a novice in programming or an experienced programmer who needs to be advanced, I believe that everyone can gain something from it.

Data collection

This full version of the full set of Python learning materials has been uploaded to the official CSDN. If you need it, you can click the CSDN official certification WeChat card below to get it for free ↓↓↓ [Guaranteed 100% free]

insert image description here

Good article recommended

Understand the prospect of python: https://blog.csdn.net/SpringJavaMyBatis/article/details/127194835

Learn about python's part-time sideline: https://blog.csdn.net/SpringJavaMyBatis/article/details/127196603

insert image description here

Guess you like

Origin blog.csdn.net/weixin_49892805/article/details/130594657