-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython.html
1061 lines (618 loc) · 48 KB
/
python.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 lt-ie8 lt-ie9"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" lang="en" dir="ltr"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="prefetch" href="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">
<meta name="application-name" content="Python.org">
<meta name="msapplication-tooltip" content="The official home of the Python Programming Language">
<meta name="apple-mobile-web-app-title" content="Python.org">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="HandheldFriendly" content="True">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="cleartype" content="on">
<meta http-equiv="imagetoolbar" content="false">
<script src="/static/js/libs/modernizr.js"></script>
<link href="/static/stylesheets/style.67f4b30f7483.css" rel="stylesheet" type="text/css" title="default" />
<link href="/static/stylesheets/mq.3ae8e02ece5b.css" rel="stylesheet" type="text/css" media="not print, braille, embossed, speech, tty" />
<!--[if (lte IE 8)&(!IEMobile)]>
<link href="/static/stylesheets/no-mq.fcf414dc68a3.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/apple-touch-icon-144x144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/apple-touch-icon-114x114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/apple-touch-icon-72x72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="/static/apple-touch-icon-precomposed.png">
<link rel="apple-touch-icon" href="/static/apple-touch-icon-precomposed.png">
<meta name="msapplication-TileImage" content="/static/metro-icon-144x144-precomposed.png"><!-- white shape -->
<meta name="msapplication-TileColor" content="#3673a5"><!-- python blue -->
<meta name="msapplication-navbutton-color" content="#3673a5">
<title>Welcome to Python.org</title>
<meta name="description" content="The official home of the Python Programming Language">
<meta name="keywords" content="Python programming language object oriented web free open source software license documentation download community">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Python.org">
<meta property="og:title" content="Welcome to Python.org">
<meta property="og:description" content="The official home of the Python Programming Language">
<meta property="og:image" content="https://www.python.org/static/opengraph-icon-200x200.png">
<meta property="og:image:secure_url" content="https://www.python.org/static/opengraph-icon-200x200.png">
<meta property="og:url" content="https://www.python.org/">
<link rel="author" href="/static/humans.txt">
<link rel="alternate" type="application/rss+xml" title="Python Enhancement Proposals"
href="https://www.python.org/dev/peps/peps.rss/">
<link rel="alternate" type="application/rss+xml" title="Python Job Opportunities"
href="https://www.python.org/jobs/feed/rss/">
<link rel="alternate" type="application/rss+xml" title="Python Software Foundation News"
href="https://feeds.feedburner.com/PythonSoftwareFoundationNews">
<link rel="alternate" type="application/rss+xml" title="Python Insider"
href="https://feeds.feedburner.com/PythonInsider">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "https://www.python.org/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://www.python.org/search/?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-39055973-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body class="python home" id="homepage">
<div id="touchnav-wrapper">
<div id="nojs" class="do-not-print">
<p><strong>Notice:</strong> While Javascript is not essential for this website, your interaction with the content will be limited. Please turn Javascript on for the full experience. </p>
</div>
<!--[if lte IE 8]>
<div id="oldie-warning" class="do-not-print">
<p>
<strong>Notice:</strong> Your browser is <em>ancient</em>. Please
<a href="http://browsehappy.com/">upgrade to a different browser</a> to experience a better web.
</p>
</div>
<![endif]-->
<!-- Sister Site Links -->
<div id="top" class="top-bar do-not-print">
<nav class="meta-navigation container" role="navigation">
<div class="skip-link screen-reader-text">
<a href="#content" title="Skip to content">Skip to content</a>
</div>
<a id="close-python-network" class="jump-link" href="#python-network" aria-hidden="true">
<span aria-hidden="true" class="icon-arrow-down"><span>▼</span></span> Close
</a>
<ul class="menu" role="tree">
<li class="python-meta current_item selectedcurrent_branch selected">
<a href="/" title="The Python Programming Language" class="current_item selectedcurrent_branch selected">Python</a>
</li>
<li class="psf-meta ">
<a href="/psf-landing/" title="The Python Software Foundation" >PSF</a>
</li>
<li class="docs-meta ">
<a href="https://docs.python.org" title="Python Documentation" >Docs</a>
</li>
<li class="pypi-meta ">
<a href="https://pypi.python.org/" title="Python Package Index" >PyPI</a>
</li>
<li class="jobs-meta ">
<a href="/jobs/" title="Python Job Board" >Jobs</a>
</li>
<li class="shop-meta ">
<a href="/community/" title="Python Community" >Community</a>
</li>
</ul>
<a id="python-network" class="jump-link" href="#top" aria-hidden="true">
<span aria-hidden="true" class="icon-arrow-up"><span>▲</span></span> The Python Network
</a>
</nav>
</div>
<!-- Header elements -->
<header class="main-header" role="banner">
<div class="container">
<h1 class="site-headline">
<a href="/"><img class="python-logo" src="/static/img/python-logo.png" alt="python™"></a>
</h1>
<div class="options-bar-container do-not-print">
<a href="/psf/donations/" class="donate-button">Donate</a>
<div class="options-bar">
<a id="site-map-link" class="jump-to-menu" href="#site-map"><span class="menu-icon">≡</span> Menu</a><form class="search-the-site" action="/search/" method="get">
<fieldset title="Search Python.org">
<span aria-hidden="true" class="icon-search"></span>
<label class="screen-reader-text" for="id-search-field">Search This Site</label>
<input id="id-search-field" name="q" type="search" role="textbox" class="search-field" placeholder="Search" value="" tabindex="1">
<button type="submit" name="submit" id="submit" class="search-button" title="Submit this Search" tabindex="3">
GO
</button>
<!--[if IE]><input type="text" style="display: none;" disabled="disabled" size="1" tabindex="4"><![endif]-->
</fieldset>
</form><span class="breaker"></span><div class="adjust-font-size" aria-hidden="true">
<ul class="navigation menu" aria-label="Adjust Text Size on Page">
<li class="tier-1 last" aria-haspopup="true">
<a href="#" class="action-trigger"><strong><small>A</small> A</strong></a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a class="text-shrink" title="Make Text Smaller" href="javascript:;">Smaller</a></li>
<li class="tier-2 element-2" role="treeitem"><a class="text-grow" title="Make Text Larger" href="javascript:;">Larger</a></li>
<li class="tier-2 element-3" role="treeitem"><a class="text-reset" title="Reset any font size changes I have made" href="javascript:;">Reset</a></li>
</ul>
</li>
</ul>
</div><div class="winkwink-nudgenudge">
<ul class="navigation menu" aria-label="Social Media Navigation">
<li class="tier-1 last" aria-haspopup="true">
<a href="#" class="action-trigger">Socialize</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="https://www.facebook.com/pythonlang?fref=ts"><span aria-hidden="true" class="icon-facebook"></span>Facebook</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="https://twitter.com/ThePSF"><span aria-hidden="true" class="icon-twitter"></span>Twitter</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/community/irc/"><span aria-hidden="true" class="icon-freenode"></span>Chat on IRC</a></li>
</ul>
</li>
</ul>
</div>
<span data-html-include="/authenticated"></span>
</div><!-- end options-bar -->
</div>
<nav id="mainnav" class="python-navigation main-navigation do-not-print" role="navigation">
<ul class="navigation menu" role="menubar" aria-label="Main Navigation">
<li id="about" class="tier-1 element-1 " aria-haspopup="true">
<a href="/about/" title="" class="">About</a>
<ul class="subnav menu" role="menu" aria-hidden="true">
<li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li>
</ul>
</li>
<li id="downloads" class="tier-1 element-2 " aria-haspopup="true">
<a href="/downloads/" title="" class="">Downloads</a>
<ul class="subnav menu" role="menu" aria-hidden="true">
<li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li>
</ul>
</li>
<li id="documentation" class="tier-1 element-3 " aria-haspopup="true">
<a href="/doc/" title="" class="">Documentation</a>
<ul class="subnav menu" role="menu" aria-hidden="true">
<li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner's Guide</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="https://devguide.python.org/" title="">Developer's Guide</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li>
<li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li>
<li class="tier-2 element-9" role="treeitem"><a href="/doc/essays/" title="">Python Essays</a></li>
</ul>
</li>
<li id="community" class="tier-1 element-4 " aria-haspopup="true">
<a href="/community/" title="" class="">Community</a>
<ul class="subnav menu" role="menu" aria-hidden="true">
<li class="tier-2 element-1" role="treeitem"><a href="/community/survey" title="">Community Survey</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/community/irc/" title="">IRC</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="/community/forums/" title="">Forums</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li>
<li class="tier-2 element-8" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li>
<li class="tier-2 element-9" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li>
<li class="tier-2 element-10" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li>
<li class="tier-2 element-11" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li>
<li class="tier-2 element-12" role="treeitem"><a href="https://www.python.org/psf/codeofconduct/" title="">Code of Conduct</a></li>
</ul>
</li>
<li id="success-stories" class="tier-1 element-5 " aria-haspopup="true">
<a href="/success-stories/" title="success-stories" class="">Success Stories</a>
<ul class="subnav menu" role="menu" aria-hidden="true">
<li class="tier-2 element-1" role="treeitem"><a href="/success-stories/category/arts/" title="">Arts</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/success-stories/category/business/" title="">Business</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/success-stories/category/education/" title="">Education</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/success-stories/category/engineering/" title="">Engineering</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="/success-stories/category/government/" title="">Government</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="/success-stories/category/scientific/" title="">Scientific</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="/success-stories/category/software-development/" title="">Software Development</a></li>
</ul>
</li>
<li id="news" class="tier-1 element-6 " aria-haspopup="true">
<a href="/blogs/" title="News from around the Python world" class="">News</a>
<ul class="subnav menu" role="menu" aria-hidden="true">
<li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li>
</ul>
</li>
<li id="events" class="tier-1 element-7 " aria-haspopup="true">
<a href="/events/" title="" class="">Events</a>
<ul class="subnav menu" role="menu" aria-hidden="true">
<li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li>
</ul>
</li>
</ul>
</nav>
<div class="header-banner "> <!-- for optional "do-not-print" class -->
<div id="dive-into-python" class="flex-slideshow slideshow">
<ul class="launch-shell menu" id="launch-shell">
<li>
<a class="button prompt" id="start-shell" data-shell-container="#dive-into-python" href="/shell/">>_
<span class="message">Launch Interactive Shell</span>
</a>
</li>
</ul>
<ul class="slides menu">
<li>
<div class="slide-code"><pre><code><span class="comment"># Python 3: Fibonacci series up to n</span>
>>> def fib(n):
>>> a, b = 0, 1
>>> while a < n:
>>> print(a, end=' ')
>>> a, b = b, a+b
>>> print()
>>> fib(1000)
<span class="output">0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987</span></code></pre></div>
<div class="slide-copy"><h1>Functions Defined</h1>
<p>The core of extensible programming is defining functions. Python allows mandatory and optional arguments, keyword arguments, and even arbitrary argument lists. <a href="//docs.python.org/3/tutorial/controlflow.html#defining-functions">More about defining functions in Python 3</a></p></div>
</li>
<li>
<div class="slide-code"><pre><code><span class="comment"># Python 3: List comprehensions</span>
>>> fruits = ['Banana', 'Apple', 'Lime']
>>> loud_fruits = [fruit.upper() for fruit in fruits]
>>> print(loud_fruits)
<span class="output">['BANANA', 'APPLE', 'LIME']</span>
<span class="comment"># List and the enumerate function</span>
>>> list(enumerate(fruits))
<span class="output">[(0, 'Banana'), (1, 'Apple'), (2, 'Lime')]</span></code></pre></div>
<div class="slide-copy"><h1>Compound Data Types</h1>
<p>Lists (known as arrays in other languages) are one of the compound data types that Python understands. Lists can be indexed, sliced and manipulated with other built-in functions. <a href="//docs.python.org/3/tutorial/introduction.html#lists">More about lists in Python 3</a></p></div>
</li>
<li>
<div class="slide-code"><pre><code><span class="comment"># Python 3: Simple arithmetic</span>
>>> 1 / 2
<span class="output">0.5</span>
>>> 2 ** 3
<span class="output">8</span>
>>> 17 / 3 <span class="comment"># classic division returns a float</span>
<span class="output">5.666666666666667</span>
>>> 17 // 3 <span class="comment"># floor division</span>
<span class="output">5</span></code></pre></div>
<div class="slide-copy"><h1>Intuitive Interpretation</h1>
<p>Calculations are simple with Python, and expression syntax is straightforward: the operators <code>+</code>, <code>-</code>, <code>*</code> and <code>/</code> work as expected; parentheses <code>()</code> can be used for grouping. <a href="http://docs.python.org/3/tutorial/introduction.html#using-python-as-a-calculator">More about simple math functions in Python 3</a>.</p></div>
</li>
<li>
<div class="slide-code"><pre><code><span class="comment"># Python 3: Simple output (with Unicode)</span>
>>> print("Hello, I'm Python!")
<span class="output">Hello, I'm Python!</span>
<span class="comment"># Input, assignment</span>
>>> name = input('What is your name?\n')
>>> print('Hi, %s.' % name)
<span class="output">What is your name?
Python
Hi, Python.</span></code></pre></div>
<div class="slide-copy"><h1>Quick & Easy to Learn</h1>
<p>Experienced programmers in any other language can pick up Python very quickly, and beginners find the clean syntax and indentation structure easy to learn. <a href="//docs.python.org/3/tutorial/">Whet your appetite</a> with our Python 3 overview.</p>
</div>
</li>
<li>
<div class="slide-code"><pre><code><span class="comment"># For loop on a list</span>
>>> numbers = [2, 4, 6, 8]
>>> product = 1
>>> for number in numbers:
... product = product * number
...
>>> print('The product is:', product)
<span class="output">The product is: 384</span></code></pre></div>
<div class="slide-copy"><h1>All the Flow You’d Expect</h1>
<p>Python knows the usual control flow statements that other languages speak — <code>if</code>, <code>for</code>, <code>while</code> and <code>range</code> — with some of its own twists, of course. <a href="//docs.python.org/3/tutorial/controlflow.html">More control flow tools in Python 3</a></p></div>
</li>
</ul>
</div>
</div>
<div class="introduction">
<p>Python is a programming language that lets you work quickly <span class="breaker"></span>and integrate systems more effectively. <a class="readmore" href="/doc/">Learn More</a></p>
</div>
</div><!-- end .container -->
</header>
<div id="content" class="content-wrapper">
<!-- Main Content Column -->
<div class="container">
<section class="main-content " role="main">
<div class="notification-bar notification-bar--survey" style="background-color: #ffdf76; color: #664e04; border-color: #004d7a; text-align: center; background-color: #004d7a; color: #fff; padding: 10px; margin: .5em; position: relative; width: 95%; background-color: #ffdf76; color: #664e04; border-color: #004d7a; border-radius: 1em;">
<span class="notification-bar__icon">
<i class="fa fa-chart-line" aria-hidden="true"></i>
</span>
<span class="notification-bar__message">Contribute to the PSF by Purchasing a PyCharm License. All proceeds benefit the PSF. <a class="button button--dark button--small button--primary" style="color: #606060; border-color: #006dad; background-color: #006dad;" href="https://www.jetbrains.com/pycharm/promo/support-python/" target="_blank" rel="noopener">Donate Now</a>
</span>
</div>
<div class="row">
<div class="small-widget get-started-widget">
<h2 class="widget-title"><span aria-hidden="true" class="icon-get-started"></span>Get Started</h2>
<p>Whether you're new to programming or an experienced developer, it's easy to learn and use Python.</p>
<p><a href="/about/gettingstarted/">Start with our Beginner’s Guide</a></p>
</div>
<div class="small-widget download-widget">
<h2 class="widget-title"><span aria-hidden="true" class="icon-download"></span>Download</h2>
<p>Python source code and installers are available for download for all versions!</p>
<p>Latest: <a href="/downloads/release/python-373/">Python 3.7.3</a></p>
</div>
<div class="small-widget documentation-widget">
<h2 class="widget-title"><span aria-hidden="true" class="icon-documentation"></span>Docs</h2>
<p>Documentation for Python's standard library, along with tutorials and guides, are available online.</p>
<p><a href="https://docs.python.org">docs.python.org</a></p>
</div>
<div class="small-widget jobs-widget last">
<h2 class="widget-title"><span aria-hidden="true" class="icon-jobs"></span>Jobs</h2>
<p>Looking for work or have a Python related position that you're trying to hire for? Our <strong>relaunched community-run job board</strong> is the place to go.</p>
<p><a href="//jobs.python.org">jobs.python.org</a></p>
</div>
</div>
<div class="list-widgets row">
<div class="medium-widget blog-widget">
<div class="shrubbery">
<h2 class="widget-title"><span aria-hidden="true" class="icon-news"></span>Latest News</h2>
<p class="give-me-more"><a href="https://blog.python.org" title="More News">More</a></p>
<ul class="menu">
<li>
<time datetime="2019-06-19T03:30:00.000002+00:00"><span class="say-no-more">2019-</span>06-19</time>
<a href="http://feedproxy.google.com/~r/PythonInsider/~3/0igDnpeIHjY/python-374rc1-and-369rc1-are-now.html">Python 3.7.4rc1 and 3.6.9rc1 are now available</a></li>
<li>
<time datetime="2019-06-18T15:16:00.000001+00:00"><span class="say-no-more">2019-</span>06-18</time>
<a href="http://feedproxy.google.com/~r/PythonInsider/~3/U3aKcpq1Bq0/pypi-now-supports-two-factor-login-via.html">PyPI Now Supports Two-Factor Login via WebAuthn</a></li>
<li>
<time datetime="2019-06-18T15:16:00.000001+00:00"><span class="say-no-more">2019-</span>06-18</time>
<a href="http://feedproxy.google.com/~r/PythonSoftwareFoundationNews/~3/3WpekcDpX4A/pypi-now-supports-two-factor-login-via.html">PyPI Now Supports Two-Factor Login via WebAuthn</a></li>
<li>
<time datetime="2019-06-12T16:43:00.000002+00:00"><span class="say-no-more">2019-</span>06-12</time>
<a href="http://feedproxy.google.com/~r/PythonSoftwareFoundationNews/~3/wV9HN81G75M/2019-board-of-directors-election-voting.html">2019 Board of Directors Election - Voting is Open</a></li>
<li>
<time datetime="2019-06-04T23:18:00.000001+00:00"><span class="say-no-more">2019-</span>06-04</time>
<a href="http://feedproxy.google.com/~r/PythonInsider/~3/pbwRlizzUMA/python-380b1-is-now-available-for.html">Python 3.8.0b1 is now available for testing</a></li>
</ul>
</div><!-- end .shrubbery -->
</div>
<div class="medium-widget event-widget last">
<div class="shrubbery">
<h2 class="widget-title"><span aria-hidden="true" class="icon-calendar"></span>Upcoming Events</h2>
<p class="give-me-more"><a href="/events/calendars/" title="More Events">More</a></p>
<ul class="menu">
<li>
<time datetime="2019-06-29T00:00:00+00:00"><span class="say-no-more">2019-</span>06-29</time>
<a href="/events/python-events/856/">PyDayNEA 2019</a></li>
<li>
<time datetime="2019-06-29T00:00:00+00:00"><span class="say-no-more">2019-</span>06-29</time>
<a href="/events/python-events/842/">PyDay Pereira</a></li>
<li>
<time datetime="2019-07-07T00:00:00+00:00"><span class="say-no-more">2019-</span>07-07</time>
<a href="/events/python-events/843/">Caipyra 2019</a></li>
<li>
<time datetime="2019-07-08T00:00:00+00:00"><span class="say-no-more">2019-</span>07-08</time>
<a href="/events/python-events/811/">SciPy 2019</a></li>
<li>
<time datetime="2019-07-08T00:00:00+00:00"><span class="say-no-more">2019-</span>07-08</time>
<a href="/events/python-events/796/">EuroPython 2019</a></li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="medium-widget success-stories-widget">
<div class="shrubbery">
<h2 class="widget-title"><span aria-hidden="true" class="icon-success-stories"></span>Success Stories</h2>
<p class="give-me-more"><a href="/success-stories/" title="More Success Stories">More</a></p>
<div class="success-story-item" id="success-story-838">
<blockquote>
<a href="/success-stories/saving-the-world-with-open-data-and-python/">When an Open Data standard is created and promoted, it’s important to think why - what change is this trying to drive? What will people do with this data that they couldn’t do before?</a>
</blockquote>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="quote-from">
<tbody>
<tr>
<td><p><a href="/success-stories/saving-the-world-with-open-data-and-python/">Saving the world with Open Data and Python</a> <em>by James Baster</em></p></td>
</tr>
</tbody>
</table>
</div>
</div><!-- end .shrubbery -->
</div>
<div class="medium-widget applications-widget last">
<div class="shrubbery">
<h2 class="widget-title"><span aria-hidden="true" class="icon-python"></span>Use Python for…</h2>
<p class="give-me-more"><a href="/about/apps" title="More Applications">More</a></p>
<ul class="menu">
<li><b>Web Development</b>:
<span class="tag-wrapper"><a class="tag" href="http://www.djangoproject.com/">Django</a>, <a class="tag" href="http://www.pylonsproject.org/">Pyramid</a>, <a class="tag" href="http://bottlepy.org">Bottle</a>, <a class="tag" href="http://tornadoweb.org">Tornado</a>, <a href="http://flask.pocoo.org/" class="tag">Flask</a>, <a class="tag" href="http://www.web2py.com/">web2py</a></span></li>
<li><b>GUI Development</b>:
<span class="tag-wrapper"><a class="tag" href="http://wiki.python.org/moin/TkInter">tkInter</a>, <a class="tag" href="https://wiki.gnome.org/Projects/PyGObject">PyGObject</a>, <a class="tag" href="http://www.riverbankcomputing.co.uk/software/pyqt/intro">PyQt</a>, <a class="tag" href="https://wiki.qt.io/PySide">PySide</a>, <a class="tag" href="https://kivy.org/">Kivy</a>, <a class="tag" href="http://www.wxpython.org/">wxPython</a></span></li>
<li><b>Scientific and Numeric</b>:
<span class="tag-wrapper">
<a class="tag" href="http://www.scipy.org">SciPy</a>, <a class="tag" href="http://pandas.pydata.org/">Pandas</a>, <a href="http://ipython.org" class="tag">IPython</a></span></li>
<li><b>Software Development</b>:
<span class="tag-wrapper"><a class="tag" href="http://buildbot.net/">Buildbot</a>, <a class="tag" href="http://trac.edgewall.org/">Trac</a>, <a class="tag" href="http://roundup.sourceforge.net/">Roundup</a></span></li>
<li><b>System Administration</b>:
<span class="tag-wrapper"><a class="tag" href="http://www.ansible.com">Ansible</a>, <a class="tag" href="http://www.saltstack.com">Salt</a>, <a class="tag" href="https://www.openstack.org">OpenStack</a></span></li>
</ul>
</div><!-- end .shrubbery -->
</div>
</div>
<div class="pep-widget">
<h2 class="widget-title">
<span class="prompt">>>></span> <a href="/dev/peps/">Python Enhancement Proposals<span class="say-no-more"> (PEPs)</span></a>: The future of Python<span class="say-no-more"> is discussed here.</span>
<a aria-hidden="true" class="rss-link" href="/dev/peps/peps.rss"><span class="icon-feed"></span> RSS</a>
</h2>
</div>
<div class="psf-widget">
<div class="python-logo"></div>
<h2 class="widget-title">
<span class="prompt">>>></span> <a href="/psf/">Python Software Foundation</a>
</h2>
<p>The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to support and facilitate the growth of a diverse and international community of Python programmers. <a class="readmore" href="/psf/">Learn more</a> </p>
<p class="click-these">
<a class="button" href="/users/membership/">Become a Member</a>
<a class="button" href="/psf/donations/">Donate to the PSF</a>
</p>
</div>
</section>
</div><!-- end .container -->
</div><!-- end #content .content-wrapper -->
<!-- Footer and social media list -->
<footer id="site-map" class="main-footer" role="contentinfo">
<div class="main-footer-links">
<div class="container">
<a id="back-to-top-1" class="jump-link" href="#python-network"><span aria-hidden="true" class="icon-arrow-up"><span>▲</span></span> Back to Top</a>
<ul class="sitemap navigation menu do-not-print" role="tree" id="container">
<li class="tier-1 element-1">
<a href="/about/" >About</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/about/apps/" title="">Applications</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/about/quotes/" title="">Quotes</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/about/gettingstarted/" title="">Getting Started</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/about/help/" title="">Help</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="http://brochure.getpython.info/" title="">Python Brochure</a></li>
</ul>
</li>
<li class="tier-1 element-2">
<a href="/downloads/" >Downloads</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/downloads/" title="">All releases</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/downloads/source/" title="">Source code</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/downloads/windows/" title="">Windows</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/downloads/mac-osx/" title="">Mac OS X</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="/download/other/" title="">Other Platforms</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="https://docs.python.org/3/license.html" title="">License</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="/download/alternatives" title="">Alternative Implementations</a></li>
</ul>
</li>
<li class="tier-1 element-3">
<a href="/doc/" >Documentation</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/doc/" title="">Docs</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/doc/av" title="">Audio/Visual Talks</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="https://wiki.python.org/moin/BeginnersGuide" title="">Beginner's Guide</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="https://devguide.python.org/" title="">Developer's Guide</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="https://docs.python.org/faq/" title="">FAQ</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="http://wiki.python.org/moin/Languages" title="">Non-English Docs</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="http://python.org/dev/peps/" title="">PEP Index</a></li>
<li class="tier-2 element-8" role="treeitem"><a href="https://wiki.python.org/moin/PythonBooks" title="">Python Books</a></li>
<li class="tier-2 element-9" role="treeitem"><a href="/doc/essays/" title="">Python Essays</a></li>
</ul>
</li>
<li class="tier-1 element-4">
<a href="/community/" >Community</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/community/survey" title="">Community Survey</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/community/diversity/" title="">Diversity</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/community/lists/" title="">Mailing Lists</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/community/irc/" title="">IRC</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="/community/forums/" title="">Forums</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="/community/workshops/" title="">Python Conferences</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="/community/sigs/" title="">Special Interest Groups</a></li>
<li class="tier-2 element-8" role="treeitem"><a href="/community/logos/" title="">Python Logo</a></li>
<li class="tier-2 element-9" role="treeitem"><a href="https://wiki.python.org/moin/" title="">Python Wiki</a></li>
<li class="tier-2 element-10" role="treeitem"><a href="/community/merchandise/" title="">Merchandise</a></li>
<li class="tier-2 element-11" role="treeitem"><a href="/community/awards" title="">Community Awards</a></li>
<li class="tier-2 element-12" role="treeitem"><a href="https://www.python.org/psf/codeofconduct/" title="">Code of Conduct</a></li>
</ul>
</li>
<li class="tier-1 element-5">
<a href="/success-stories/" title="success-stories">Success Stories</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/success-stories/category/arts/" title="">Arts</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/success-stories/category/business/" title="">Business</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/success-stories/category/education/" title="">Education</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/success-stories/category/engineering/" title="">Engineering</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="/success-stories/category/government/" title="">Government</a></li>
<li class="tier-2 element-6" role="treeitem"><a href="/success-stories/category/scientific/" title="">Scientific</a></li>
<li class="tier-2 element-7" role="treeitem"><a href="/success-stories/category/software-development/" title="">Software Development</a></li>
</ul>
</li>
<li class="tier-1 element-6">
<a href="/blogs/" title="News from around the Python world">News</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/blogs/" title="Python Insider Blog Posts">Python News</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="http://planetpython.org/" title="Planet Python">Community News</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="http://pyfound.blogspot.com/" title="PSF Blog">PSF News</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="http://pycon.blogspot.com/" title="PyCon Blog">PyCon News</a></li>
</ul>
</li>
<li class="tier-1 element-7">
<a href="/events/" >Events</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="/events/python-events" title="">Python Events</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="/events/python-user-group/" title="">User Group Events</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="/events/python-events/past/" title="">Python Events Archive</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/events/python-user-group/past/" title="">User Group Events Archive</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="https://wiki.python.org/moin/PythonEventsCalendar#Submitting_an_Event" title="">Submit an Event</a></li>
</ul>
</li>
<li class="tier-1 element-8">
<a href="/dev/" >Contributing</a>
<ul class="subnav menu">
<li class="tier-2 element-1" role="treeitem"><a href="https://devguide.python.org/" title="">Developer's Guide</a></li>
<li class="tier-2 element-2" role="treeitem"><a href="https://bugs.python.org/" title="">Issue Tracker</a></li>
<li class="tier-2 element-3" role="treeitem"><a href="https://mail.python.org/mailman/listinfo/python-dev" title="">python-dev list</a></li>
<li class="tier-2 element-4" role="treeitem"><a href="/dev/core-mentorship/" title="">Core Mentorship</a></li>
<li class="tier-2 element-5" role="treeitem"><a href="/news/security/" title="">Report a Security Issue</a></li>
</ul>
</li>
</ul>
<a id="back-to-top-2" class="jump-link" href="#python-network"><span aria-hidden="true" class="icon-arrow-up"><span>▲</span></span> Back to Top</a>