标签:Basics string just Python value rules only
These rules for putting operators and values together to form expressions are a fundamental part of Python as a programming language, just like the grammar rules that help us communicate.
[Python Tutor - Visualize Python]
Remember that expressions are just values combined with operators, and they always evaluate down to a single value. A data type,say,The Integer, Floating-Point, and String Data Types.–> int(), float()and str(’ '),
The Interger :-5,0,35, 1,2,3
Floating point:-0.25, 2.3, 1.75
Strings are like ‘a’, ‘bbb’, ‘Hello world!’, ‘5 dogs’ The single quote should be 2 in the begin and end of strings.If just type one,then it will shown SyntaxError: EOL while scanning string literal. Cuz (’) characters are the signals for Python to known the strings begins and ends.
The *operator can be used with only two numeric values (for multiplication), or one string value and one integer value (for string replication).
Storing Values in Variables,Imaging Variables as a store value box in computer’s memory.When a variable is assigned a new value, the old value is forgotten.
When name a variable,3 principle rules as follows:
1.It can be only one word with no spaces.
2.It can use only letters, numbers, and the underscore (_) character.
3.It can’t begin with a number.
(P.S. Variable names are case-sensitive that means WE,we,We are 3 difference variables.)
Tool: >>> interactive shell and file editor(or say text editors such as Notepad or TextMate)
The hash mark # is part of comments are use for recording the notes.
Different types of operators +, -, *, /, //, %, and **for math operations,
+and *for string operations.
When write a function name, the opening and closing parentheses() at the end identify it as the name of a function.such as print(),input(),and len() functions.
Extension of built-in functions check up->[Built-in Functions — Python 3.9.6 documentation]
i潜能开发ONELiving
标签:Basics,string,just,Python,value,rules,only 来源: https://blog.csdn.net/maxinec93/article/details/118633089
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。