Getting started with Python: all the odd and even numbers within the output 1-100

Source: Internet
Author: User

1 #!/usr/bin/env python2 #-*-coding:utf-8-*-3 #all odd and even numbers within the output 1-1004 """5 Assign value to start equals 1,while true, loop starts, assignment of temp equals the remainder of start and 26 if temp equals 0 (the remainder equals 0,start is odd, otherwise an even number) prints the start7 Otherwise pass, nothing is executed, start assignment equals start plus 1, until the assignment equals 1008 while the condition is false, the loop no longer holds! 9 #打印偶数同理! Ten """ OneStart =1 A  whileStart < 101: -     #print (start) -     #if it is odd, the output the     #Otherwise, no matter -     #(transliteration: Talk about breaking) -temp = start% 2 -     #temp is the remainder, remainder = 0, even, otherwise: odd +     iftemp = =0: -         Print(start) +     Else: A         Pass#Pass does not perform anything (must write, do not write grammar error) atStart + = 1

Getting started with Python: all the odd and even numbers within the output 1-100

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.