当前位置:网站首页>The solution to prompt "this list creation could be rewritten as a list literal" when adding elements to the list using the append() method in pychart
The solution to prompt "this list creation could be rewritten as a list literal" when adding elements to the list using the append() method in pychart
2022-06-23 04:53:00 【Haohong image algorithm】
stay Pycharm Use in append() Method to add elements to the list "This list creation could be rewritten as a list literal", The screenshot is as follows :
"This list creation could be rewritten as a list literal.” It means that the creation of this list can be rewritten more easily .
What do you mean ?
Let's look at the above two lines of code :
list1 = ['Google', 'CSDN', 'tencent', 1997, 1999, 1998]
list1.append(2000)
You can see , Because there is no operation in the middle , therefore Pycharm Judge that the two sentences of code can be combined into the following statement :
list1 = ['Google', 'CSDN', 'tencent', 1997, 1999, 1998, 2000]
So it makes a hint in the title “This list creation could be rewritten as a list literal”.
How to make it disappear ? It's simple , Add any statement between two sentences of code , Like the following :
list1 = ['Google', 'CSDN', 'tencent', 1997, 1999, 1998]
kkk = 1
list1.append(2000)

From the screenshot above, we can see , The prompt is gone .
边栏推荐
猜你喜欢

Abnova ACTN4纯化兔多克隆抗体说明书

STL教程3-异常机制

Common concepts and terms in offline warehouse modeling

聊聊 C# 中的 Composite 模式

Reinstallation of cadence16.3, failure and success

OGNL Object-Graph Navigation Language

Abnova liquidcell negative enrichment cell separation and recovery system

volatile 与线程的那些事

Please use the NLTK Downloader to obtain the resource

Abnova blood total nucleic acid purification kit protocol
随机推荐
Bootstrap drive, top switching power supply and Optocoupler
Usage of API interface test ------ post
Reinstallation of cadence16.3, failure and success
thinkphp6 无关联ID的连表查询(2张表)主要是select的应用
Pta:7-60 pet growth
力扣今日题513. 找树左下角的值
QT elidedText 只对中文符合起作用,对英文不起作用的问题解决
Pta:7-67 friend is very simple 2016final
开关磁阻电机悬浮驱动IR2128小结
Can bus Basics
如何解决独立站多渠道客户沟通难题?这款跨境电商插件一定要知道!
Notes on writing questions in C language -- free falling ball
Abnova abcb10 (human) recombinant protein specification
Permission Operation in dynamics 365 plug-in
Alkylation process test questions and simulation test in 2022
Examples of corpus data processing cases (part of speech encoding, part of speech restoration)
395. 冗余路径
Pta:7-31 journal charges
Laravel 通过服务提供者来自定义分页样式
MySQL导入大文件(可以是百万级,也可以是百级)