Skip to content

Commit

Permalink
Site updated: 2024-03-14 14:29:40
Browse files Browse the repository at this point in the history
  • Loading branch information
zade23 committed Mar 14, 2024
1 parent 8e27921 commit d530b3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<meta property="og:image" content="https://raw.githubusercontent.com/usingnamespaceX/picture_bed/main/Python_modules%26package.png">
<meta property="og:image" content="https://s21.ax1x.com/2024/03/14/pFcXu5T.png">
<meta property="article:published_time" content="2024-03-13T06:12:24.000Z">
<meta property="article:modified_time" content="2024-03-14T06:22:24.711Z">
<meta property="article:modified_time" content="2024-03-14T06:29:05.733Z">
<meta property="article:author" content="Android">
<meta property="article:tag" content="Python">
<meta name="twitter:card" content="summary">
Expand Down Expand Up @@ -421,7 +421,7 @@ <h3 id="导入方式"><a href="#导入方式" class="headerlink" title="导入
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">from</span> fibo <span class="keyword">import</span> *</span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span>fib(<span class="number">500</span>)</span><br><span class="line"><span class="number">0</span> <span class="number">1</span> <span class="number">1</span> <span class="number">2</span> <span class="number">3</span> <span class="number">5</span> <span class="number">8</span> <span class="number">13</span> <span class="number">21</span> <span class="number">34</span> <span class="number">55</span> <span class="number">89</span> <span class="number">144</span> <span class="number">233</span> <span class="number">377</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>模块名使用<code>as</code>,直接把<code>as</code>后的名称与导入模块绑定</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">import</span> fibo <span class="keyword">as</span> fibo</span><br><span class="line">&gt;&gt; fib.fib(<span class="number">500</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">import</span> fibo <span class="keyword">as</span> fibo</span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span>fib.fib(<span class="number">500</span>)</span><br></pre></td></tr></table></figure>
</li>
<li><p>结合<code>from</code>一起使用</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">from</span> fibo <span class="keyword">import</span> fib <span class="keyword">as</span> fibonacci</span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span>fibonacci(<span class="number">500</span>)</span><br></pre></td></tr></table></figure></li>
Expand Down
Loading

0 comments on commit d530b3f

Please sign in to comment.