forked from Huxpro/huxpro.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,133 additions
and
0 deletions.
There are no files selected for viewing
135 changes: 135 additions & 0 deletions
135
...l--Converters--Markdown/45/859994eb101af0130fc3d9555c61a7f0d06ddeb87de101ce61874b8933764e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
I"�<h2 id="注释">注释</h2> | ||
|
||
<p>单行注释 - 以#和空格开头的部分 | ||
多行注释 - 三个引号开头,三个引号结尾 (单引号与双引号仅有微小区别,可以忽略)</p> | ||
|
||
<h4 id="单行注释">单行注释</h4> | ||
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1 | ||
</pre></td><td class="rouge-code"><pre><span class="n">a</span> <span class="o">=</span> <span class="n">b</span> <span class="o">+</span> <span class="n">c</span> <span class="c1"># 这是一条注释 | ||
</span></pre></td></tr></tbody></table></code></pre></div></div> | ||
<h4 id="多行注释">多行注释</h4> | ||
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
</pre></td><td class="rouge-code"><pre><span class="k">print</span><span class="p">(</span><span class="s">"下面是多行注释"</span><span class="p">)</span> | ||
<span class="s">""" | ||
print("注释") | ||
print("注释不会编译") | ||
print("可以看到print的字体颜色改变了") | ||
"""</span> | ||
</pre></td></tr></tbody></table></code></pre></div></div> | ||
|
||
<h2 id="数据类型">数据类型</h2> | ||
|
||
<h4 id="常用数据类型">常用数据类型:</h4> | ||
|
||
<ul> | ||
<li>整形 int</li> | ||
<li>浮点型 float</li> | ||
<li>字符串型 ‘hello’ or “hello” (单引号与双引号仅有微小区别,可以忽略)</li> | ||
<li>布尔型 True or False</li> | ||
</ul> | ||
|
||
<h4 id="变量">变量</h4> | ||
|
||
<ul> | ||
<li>变量命名:建议采用 <strong>全小写加下划线</strong> 的拼写,不能以数字开头,大小写敏感,见名识义。</li> | ||
<li>使用<code class="highlighter-rouge">type</code>函数检查变量的类型 | ||
<pre><code class="language-Python">a = 100 | ||
b = 12.345 | ||
c = 1 + 5j | ||
d = 'hello, world' | ||
e = True | ||
print(type(a)) # <class 'int'> | ||
print(type(b)) # <class 'float'> | ||
print(type(c)) # <class 'complex'> | ||
print(type(d)) # <class 'str'> | ||
print(type(e)) # <class 'bool'> | ||
</code></pre> | ||
</li> | ||
<li>使用Python内置函数转换变量类型</li> | ||
<li><code class="highlighter-rouge">int()</code>:将一个数值或字符串转换成整数,可以指定进制。</li> | ||
<li><code class="highlighter-rouge">float()</code>:将一个字符串转换成浮点数。</li> | ||
<li><code class="highlighter-rouge">str()</code>:将指定的对象转换成字符串形式,可以指定编码。</li> | ||
<li><code class="highlighter-rouge">chr()</code>:将整数转换成该编码对应的字符串(一个字符)。</li> | ||
<li><code class="highlighter-rouge">ord()</code>:将字符串(一个字符)转换成对应的编码(整数)。</li> | ||
</ul> | ||
|
||
<h4 id="运算符">运算符</h4> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>运算符</th> | ||
<th>描述</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><code class="highlighter-rouge">[]</code> <code class="highlighter-rouge">[:]</code></td> | ||
<td>下标,切片</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">**</code></td> | ||
<td>指数</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">~</code> <code class="highlighter-rouge">+</code> <code class="highlighter-rouge">-</code></td> | ||
<td>按位取反, 正负号</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">*</code> <code class="highlighter-rouge">/</code> <code class="highlighter-rouge">%</code> <code class="highlighter-rouge">//</code></td> | ||
<td>乘,除,模,整除</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">+</code> <code class="highlighter-rouge">-</code></td> | ||
<td>加,减</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">>></code> <code class="highlighter-rouge"><<</code></td> | ||
<td>右移,左移</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">&</code></td> | ||
<td>按位与</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">^</code> <code class="highlighter-rouge">\|</code></td> | ||
<td>按位异或,按位或</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge"><=</code> <code class="highlighter-rouge"><</code> <code class="highlighter-rouge">></code> <code class="highlighter-rouge">>=</code></td> | ||
<td>小于等于,小于,大于,大于等于</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">==</code> <code class="highlighter-rouge">!=</code></td> | ||
<td>等于,不等于</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">is</code> <code class="highlighter-rouge">is not</code></td> | ||
<td>身份运算符</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">in</code> <code class="highlighter-rouge">not in</code></td> | ||
<td>成员运算符</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">not</code> <code class="highlighter-rouge">or</code> <code class="highlighter-rouge">and</code></td> | ||
<td>逻辑运算符</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">=</code> <code class="highlighter-rouge">+=</code> <code class="highlighter-rouge">-=</code> <code class="highlighter-rouge">*=</code> <code class="highlighter-rouge">/=</code> <code class="highlighter-rouge">%=</code> <code class="highlighter-rouge">//=</code> <code class="highlighter-rouge">**=</code> <code class="highlighter-rouge">&=</code> <code class="highlighter-rouge">|=</code> <code class="highlighter-rouge">^=</code> <code class="highlighter-rouge">>>=</code> <code class="highlighter-rouge"><<=</code></td> | ||
<td>(复合)赋值运算符</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<blockquote> | ||
<p><strong>说明:</strong> 在实际开发中,如果搞不清楚运算符的优先级,可以使用括号来确保运算的执行顺序。</p> | ||
</blockquote> | ||
|
||
<p><strong>Friendly reminder:</strong> This series are my own study notes of <strong><a href="https://github.com/jackfrued/Python-100-Days">Python-100-Days</a></strong>. I do not own copyright of some of the content. Nor is this a good tutorial of Python. But if you find mistakes or errors in the notes, please tell me. I really appreciate that. <strong>The whole series are not allowed to be reproduced</strong>.</p> | ||
:ET |
134 changes: 134 additions & 0 deletions
134
...l--Converters--Markdown/58/e9bff5c161289bce49a2e7d5844318312cb9918afa82a954a6c4b3dc489ee4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
I"n<h2 id="注释">注释</h2> | ||
|
||
<p>单行注释 - 以#和空格开头的部分 | ||
多行注释 - 三个引号开头,三个引号结尾 (单引号与双引号仅有微小区别,可以忽略)</p> | ||
|
||
<h4 id="单行注释">单行注释</h4> | ||
<pre><code class="language-Python">a = b + c # 这是一条注释 | ||
</code></pre> | ||
<h4 id="多行注释">多行注释</h4> | ||
<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
</pre></td><td class="rouge-code"><pre><span class="k">print</span><span class="p">(</span><span class="s">"下面是多行注释"</span><span class="p">)</span> | ||
<span class="s">""" | ||
print("我是注释") | ||
print("因为是注释") | ||
print("所以不会进行编译") | ||
"""</span> | ||
</pre></td></tr></tbody></table></code></pre></div></div> | ||
|
||
<h2 id="数据类型">数据类型</h2> | ||
|
||
<h4 id="常用数据类型">常用数据类型:</h4> | ||
|
||
<ul> | ||
<li>整形 int</li> | ||
<li>浮点型 float</li> | ||
<li>字符串型 ‘hello’ or “hello” (单引号与双引号仅有微小区别,可以忽略)</li> | ||
<li>布尔型 True or False</li> | ||
</ul> | ||
|
||
<h4 id="变量">变量</h4> | ||
|
||
<ul> | ||
<li>变量命名:建议采用 <strong>全小写加下划线</strong> 的拼写,不能以数字开头,大小写敏感,见名识义。</li> | ||
<li>使用<code class="highlighter-rouge">type</code>函数检查变量的类型 | ||
<pre><code class="language-Python">a = 100 | ||
b = 12.345 | ||
c = 1 + 5j | ||
d = 'hello, world' | ||
e = True | ||
print(type(a)) # <class 'int'> | ||
print(type(b)) # <class 'float'> | ||
print(type(c)) # <class 'complex'> | ||
print(type(d)) # <class 'str'> | ||
print(type(e)) # <class 'bool'> | ||
</code></pre> | ||
</li> | ||
<li>使用Python内置函数转换变量类型</li> | ||
<li><code class="highlighter-rouge">int()</code>:将一个数值或字符串转换成整数,可以指定进制。</li> | ||
<li><code class="highlighter-rouge">float()</code>:将一个字符串转换成浮点数。</li> | ||
<li><code class="highlighter-rouge">str()</code>:将指定的对象转换成字符串形式,可以指定编码。</li> | ||
<li><code class="highlighter-rouge">chr()</code>:将整数转换成该编码对应的字符串(一个字符)。</li> | ||
<li><code class="highlighter-rouge">ord()</code>:将字符串(一个字符)转换成对应的编码(整数)。</li> | ||
</ul> | ||
|
||
<h4 id="运算符">运算符</h4> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>运算符</th> | ||
<th>描述</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td><code class="highlighter-rouge">[]</code> <code class="highlighter-rouge">[:]</code></td> | ||
<td>下标,切片</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">**</code></td> | ||
<td>指数</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">~</code> <code class="highlighter-rouge">+</code> <code class="highlighter-rouge">-</code></td> | ||
<td>按位取反, 正负号</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">*</code> <code class="highlighter-rouge">/</code> <code class="highlighter-rouge">%</code> <code class="highlighter-rouge">//</code></td> | ||
<td>乘,除,模,整除</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">+</code> <code class="highlighter-rouge">-</code></td> | ||
<td>加,减</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">>></code> <code class="highlighter-rouge"><<</code></td> | ||
<td>右移,左移</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">&</code></td> | ||
<td>按位与</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">^</code> <code class="highlighter-rouge">\|</code></td> | ||
<td>按位异或,按位或</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge"><=</code> <code class="highlighter-rouge"><</code> <code class="highlighter-rouge">></code> <code class="highlighter-rouge">>=</code></td> | ||
<td>小于等于,小于,大于,大于等于</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">==</code> <code class="highlighter-rouge">!=</code></td> | ||
<td>等于,不等于</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">is</code> <code class="highlighter-rouge">is not</code></td> | ||
<td>身份运算符</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">in</code> <code class="highlighter-rouge">not in</code></td> | ||
<td>成员运算符</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">not</code> <code class="highlighter-rouge">or</code> <code class="highlighter-rouge">and</code></td> | ||
<td>逻辑运算符</td> | ||
</tr> | ||
<tr> | ||
<td><code class="highlighter-rouge">=</code> <code class="highlighter-rouge">+=</code> <code class="highlighter-rouge">-=</code> <code class="highlighter-rouge">*=</code> <code class="highlighter-rouge">/=</code> <code class="highlighter-rouge">%=</code> <code class="highlighter-rouge">//=</code> <code class="highlighter-rouge">**=</code> <code class="highlighter-rouge">&=</code> <code class="highlighter-rouge">|=</code> <code class="highlighter-rouge">^=</code> <code class="highlighter-rouge">>>=</code> <code class="highlighter-rouge"><<=</code></td> | ||
<td>(复合)赋值运算符</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<blockquote> | ||
<p><strong>说明:</strong> 在实际开发中,如果搞不清楚运算符的优先级,可以使用括号来确保运算的执行顺序。</p> | ||
</blockquote> | ||
|
||
<p><strong>Friendly reminder:</strong> This series are my own study notes of <strong><a href="https://github.com/jackfrued/Python-100-Days">Python-100-Days</a></strong>. I do not own copyright of some of the content. Nor is this a good tutorial of Python. But if you find mistakes or errors in the notes, please tell me. I really appreciate that. <strong>The whole series are not allowed to be reproduced</strong>.</p> | ||
:ET |
16 changes: 16 additions & 0 deletions
16
...l--Converters--Markdown/60/93c4be89d1e92b1f5de5b5680162a9ece84d33a39e2cba82e99f90b68eaadf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
I"m<p><strong>Friendly reminder:</strong> This series are my own study notes of <strong><a href="https://github.com/jackfrued/Python-100-Days">Python-100-Days</a></strong>. I do not own copyright of some of the content. Nor is this a good tutorial of Python. But if you find mistakes or errors in the notes, please tell me. I really appreciate that. <strong>The whole series are not allowed to be reproduced</strong>.</p> | ||
|
||
<h2 id="tools-used">Tools used:</h2> | ||
|
||
<ul> | ||
<li>Python 3.8 Win</li> | ||
<li>PyCharm</li> | ||
<li><a href="https://github.com/jackfrued/Python-100-Days">Python-100-Days</a></li> | ||
<li><a href="http://pingce.ayyz.cn:9000/vijos/Index.asp">Ayyz-Vijos</a></li> | ||
<li><a href="https://help.github.com/cn/github/writing-on-github/basic-writing-and-formatting-syntax#ignoring-markdown-formatting">MarkDown help</a></li> | ||
</ul> | ||
|
||
<h2 id="catalog">Catalog:</h2> | ||
|
||
<p>-</p> | ||
:ET |
Oops, something went wrong.