Python Introductory statement (if statement, while statement, for statement)

Source: Internet
Author: User
Python introductory statement, including if statement, while statement, for statement, for Python beginners reference.

If statement Example name = ' Peirong '; if name = = ' Peirong ': print ' This is Peirong ', elif name== ' Maojun ': print ' this is Maojun '; else: print ' others ';//while statement i = 0;a = Range (ten), while I < a.__len__ (): Print i; i = i+1;//for statement a = range (1,10); for i in A:print I;else:print ' The To loop is over! ' Continue Statement A = range (+) for I in a:  if I% 3 = = 0:    print ' Chuyi 3 Yu 0 ';  elif I% 3 = = 1:    print ' Chuyi 3 yu 1 ';  else:    continue
  • 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.