<!DOCTYPE html>
<html lang="en"
>
<head>
    <title>第14課 - forRange with Lists forRange與列表 - 2017Spring 協同產品設計實習 (虎尾科大MDE)</title>
    <!-- Using the latest rendering mode for IE -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">



<link rel="canonical" href="./Lesson 14.html">

        <meta name="author" content="40423222" />
        <meta name="keywords" content="notes,Lesson 14" />
        <meta name="description" content="關於for的range( )配合列表的介紹 參考資訊: 網站: https://automatetheboringstuff.com/chapter4/ 影片: https://www.youtube.com/watch?v=umTnflPbYww" />

        <meta property="og:site_name" content="2017Spring 協同產品設計實習 (虎尾科大MDE)" />
        <meta property="og:type" content="article"/>
        <meta property="og:title" content="第14課 - forRange with Lists forRange與列表"/>
        <meta property="og:url" content="./Lesson 14.html"/>
        <meta property="og:description" content="關於for的range( )配合列表的介紹 參考資訊: 網站: https://automatetheboringstuff.com/chapter4/ 影片: https://www.youtube.com/watch?v=umTnflPbYww"/>
        <meta property="article:published_time" content="2017-09-10" />
            <meta property="article:section" content="Python" />
            <meta property="article:tag" content="notes" />
            <meta property="article:tag" content="Lesson 14" />
            <meta property="article:author" content="40423222" />


    <!-- Bootstrap -->
        <link rel="stylesheet" href="./theme/css/bootstrap.united.min.css" type="text/css"/>
    <link href="./theme/css/font-awesome.min.css" rel="stylesheet">

    <link href="./theme/css/pygments/monokai.css" rel="stylesheet">
    <link href="./theme/tipuesearch/tipuesearch.css" rel="stylesheet">
    <link rel="stylesheet" href="./theme/css/style.css" type="text/css"/>

        <link href="./feeds/all.atom.xml" type="application/atom+xml" rel="alternate"
              title="2017Spring 協同產品設計實習 (虎尾科大MDE) ATOM Feed"/>

<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shCore.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushJScript.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushJava.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushPython.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushSql.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushXml.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushPhp.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushCpp.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushCss.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushCSharp.js"></script>
<script type="text/javascript" src="https://coursemdetw.github.io/project_site_files/files/syntaxhighlighter/shBrushBash.js"></script>
<script type='text/javascript'>
	(function(){
		var corecss = document.createElement('link');
		var themecss = document.createElement('link');
		var corecssurl = "https://chiamingyen.github.io/kmolab_data/files/syntaxhighlighter/css/shCore.css";
		if ( corecss.setAttribute ) {
				corecss.setAttribute( "rel", "stylesheet" );
				corecss.setAttribute( "type", "text/css" );
				corecss.setAttribute( "href", corecssurl );
		} else {
				corecss.rel = "stylesheet";
				corecss.href = corecssurl;
		}
		document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
		var themecssurl = "https://chiamingyen.github.io/kmolab_data/files/syntaxhighlighter/css/shThemeDefault.css?ver=3.0.9b";
		if ( themecss.setAttribute ) {
				themecss.setAttribute( "rel", "stylesheet" );
				themecss.setAttribute( "type", "text/css" );
				themecss.setAttribute( "href", themecssurl );
		} else {
				themecss.rel = "stylesheet";
				themecss.href = themecssurl;
		}
		//document.getElementById("syntaxhighlighteranchor").appendChild(themecss);
		document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
	})();
	SyntaxHighlighter.config.strings.expandSource = '+ expand source';
	SyntaxHighlighter.config.strings.help = '?';
	SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n';
	SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: ';
	SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: ';
	SyntaxHighlighter.defaults['pad-line-numbers'] = false;
	SyntaxHighlighter.defaults['toolbar'] = false;
	SyntaxHighlighter.all();
</script>

</head>
<body>

<div class="navbar navbar-default navbar-fixed-top" role="navigation">
	<div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a href="./" class="navbar-brand">
2017Spring 協同產品設計實習 (虎尾科大MDE)            </a>
        </div>
        <div class="collapse navbar-collapse navbar-ex1-collapse">
            <ul class="nav navbar-nav">
                         <li><a href="./pages/about/">
                             About
                          </a></li>
                        <li class="active">
                            <a href="./category/python.html">Python</a>
                        </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
              <li><span>
                <form class="navbar-search" action="./search.html">
                  <input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input" required>
                </form></span>
              </li>
              <li><a href="./archives.html"><i class="fa fa-th-list"></i><span class="icon-label">Archives</span></a></li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
</div> <!-- /.navbar -->
<!-- Banner -->
<!-- End Banner -->
<div class="container">
    <div class="row">
        <div class="col-sm-9">

    <section id="content">
        <article>
            <header class="page-header">
                <h1>
                    <a href="./Lesson 14.html"
                       rel="bookmark"
                       title="Permalink to 第14課 - forRange with Lists forRange與列表">
                        第14課 - forRange with Lists forRange與列表
                    </a>
                </h1>
            </header>
            <div class="entry-content">
                <div class="panel">
                    <div class="panel-body">
<footer class="post-info">
    <span class="label label-default">Date</span>
    <span class="published">
        <i class="fa fa-calendar"></i><time datetime="2017-09-10T18:44:00+08:00"> Sun 10 September 2017</time>
    </span>
            <span class="label label-default">By</span>
            <a href="./author/40423222.html"><i class="fa fa-user"></i> 40423222</a>



<span class="label label-default">Tags</span>
	<a href="./tag/notes.html">notes</a>
        /
	<a href="./tag/lesson-14.html">Lesson 14</a>
    
</footer><!-- /.post-info -->                    </div>
                </div>
                <p>關於for的range( )配合列表的介紹<br>
參考資訊:
網站: <a href="https://automatetheboringstuff.com/chapter4/">https://automatetheboringstuff.com/chapter4/</a>
影片: <a href="https://www.youtube.com/watch?v=umTnflPbYww">https://www.youtube.com/watch?v=umTnflPbYww</a></p>


<hr>

<!-- 關於for的range與列表功用的介紹 -->

<h3>說明:</h3>
<p>forRange with Lists forRange與列表
<ul>
<li>for i in range(4) 等於 for i in [0, 1, 2, 3],所以在L-13的Lists能使用for i in ListsName
<li>常見的Python所使用的range範圍為 range(len(someList)),也就是看列表長度
<li>可利用List來建立operators(運算符號),利用值in列表得出True or False
<li>更多功能在下方圖片介紹
</ul></p>
<hr>

<!-- 因為圖片字太小所以要更改平時的圖片格式,需要改回來 可以去參考第11課 -->

<h3>forRange跟Lists的用法:</h3>
<p><img src="./../data/L-14/img/forRange with Lists.png" width="850"></p>
            </div>
            <!-- /.entry-content -->
        </article>
    </section>

        </div>
        <div class="col-sm-3" id="sidebar">
            <aside>

<section class="well well-sm">
    <ul class="list-group list-group-flush">

            <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Recent Posts</span></h4>
                <ul class="list-group" id="recentposts">
                    <li class="list-group-item">
                        <a href="./Lesson 16.html">
                            第16課 - type( ), mutable and Immutable, copy( ) 列表更多應用
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="./Lesson 15.html">
                            第15課 - index( ), append( ), insert( ), remove( ), sort( ) 用於列表的指令
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="./Lesson 14.html">
                            第14課 - forRange with Lists forRange與列表
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="./Lesson 13.html">
                            第13課 - Lists 列表
                        </a>
                    </li>
                    <li class="list-group-item">
                        <a href="./Flowchart.html">
                            Python flowchart 目錄
                        </a>
                    </li>
                </ul>
            </li>

            <li class="list-group-item"><a href="./categories.html"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Categories</span></h4></a>
                <ul class="list-group" id="categories">
                    <li class="list-group-item">
                        <a href="./category/python.html">
                            <i class="fa fa-folder-open fa-lg"></i> Python
                        </a>
                    </li>
                </ul>
            </li>

            <li class="list-group-item"><a href="./tags.html"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a>
                <ul class="list-group list-inline tagcloud" id="tags">
                </ul>
            </li>
    <li class="list-group-item"><h4><i class="fa fa-external-link-square fa-lg"></i><span class="icon-label">Links</span></h4>
      <ul class="list-group" id="links">
        <li class="list-group-item">
            <a href="http://getpelican.com/" target="_blank">
                Pelican
            </a>
        </li>
        <li class="list-group-item">
            <a href="https://github.com/DandyDev/pelican-bootstrap3/" target="_blank">
                pelican-bootstrap3
            </a>
        </li>
        <li class="list-group-item">
            <a href="https://github.com/getpelican/pelican-plugins" target="_blank">
                pelican-plugins
            </a>
        </li>
        <li class="list-group-item">
            <a href="https://github.com/Tipue/Tipue-Search" target="_blank">
                Tipue search
            </a>
        </li>
      </ul>
    </li>
    </ul>
</section>
            </aside>
        </div>
    </div>
</div>
<footer>
   <div class="container">
      <hr>
      <div class="row">
         <div class="col-xs-10">&copy; 2017 KMOL
            &middot; Powered by <a href="https://github.com/DandyDev/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>,
            <a href="http://docs.getpelican.com/" target="_blank">Pelican</a>,
            <a href="http://getbootstrap.com" target="_blank">Bootstrap</a>         </div>
         <div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div>
      </div>
   </div>
</footer>
<script src="./theme/js/jquery.min.js"></script>

<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="./theme/js/bootstrap.min.js"></script>

<!-- for https://github.com/jsor/lity lightbox video popup -->

<link href="./theme/css/lity.css" rel="stylesheet">

<script src="./theme/js/lity.js"></script>

<!-- Enable responsive features in IE8 with Respond.js (https://github.com/scottjehl/Respond) -->
<script src="./theme/js/respond.min.js"></script>


</body>
</html>