鱼C论坛

 找回密码
 立即注册
查看: 2160|回复: 0

[技术交流] 零基础学python-5-9课

[复制链接]
发表于 2017-6-19 21:32:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 872370398 于 2017-6-19 21:42 编辑

10        "Good example:
>>> myteacher = '小甲鱼'
>>> yourteacher = myteacher-------(2)
>>> myteacher = '黑夜'
>>> print(yourteacher)
Result is 小甲鱼. It means when doing Line 2, your teacher is give the string directly rather than linked to my teacher"

11        When  need to use module, we should import module first. E.g Import Random.
        for functions in the module, it writes as c=random.int(1,10)

12        5e15=5*10^15
        About data type
        type(5e15)=> <class 'float'>
        isinstance(5e15,float)=> True

13        for target/element in expression/list
        Loop part
       
        A String can be seen as collection of alphabets
       
14        Range, generate a list include the first para not the end para
        for I in range(5)=>[0,4]
        for I in range(2,9)=>2~8
        for I in range (1,10, 2)
        the third para is the step

15        Break in loop body
        stop execution and jump out of loop (even while criteria is still true)

16        Continue
        Stop the current executing the remaining lines in this current loop and jump to next round of loop (need to test criteria again)

本帖被以下淘专辑推荐:

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-24 16:58

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表