Python basic Syntax Break,return,print

Source: Internet
Author: User

defFun (): forXinchRange (4):        Print(x) fun ()#Call the fun function, print all results-(Result: 0,1,2,3)defFun (): forXinchRange (4):        returnXfun ()#Call the fun function, return the value returned in the function, the caller cannot see-(see no result with the naked eye)defFun (): forXinchRange (4):        returnxPrint(Fun ())#Input Function Fun,for The first x value is returned by return, and the final break loop-(Result: 0)defFun (): forXinchRange (4):        Print(x) BreakFun ()#Call the fun function, print the result for the first output of print, Break end loop-(Result: 0)defFun (): forXinchRange (4):        Print(x) Break    return1Print(Fun ())#The output fun function, after the break end loop, returns can also return a value in the function-(Result: 0,1)

#break终止for循环 return and input collocation with print call, separate call no result

Python basic Syntax Break,return,print

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.