zoukankan      html  css  js  c++  java
  • python学习-第一天

    最近,搞了搞python:

    学习python 要用到两个东西:

    python:这个python。网上搜索进行下载就可以了,下载之后配置环境变量就可以了。

    pycharm:这个是集成的python开发工具。这个是编辑器还不错,网上下载,安装,汉化。

    汉化参考,但是貌似我的没有成功。

    https://jingyan.baidu.com/article/9113f81b708fd62b3214c71c.html

    修改配色方案:

    https://www.cnblogs.com/JetpropelledSnake/p/8709604.html

     爬虫案例:

    https://www.cnblogs.com/panzi/p/6421826.html

    python变量:

    规则:不能数字开头,不能有特殊符号 $

    name = "zhao"
    print(name)
    

    python:注释

    字符编码:

    程序注释:

    # 单行注释

    ''' ''' """ """ 三个冒号开始,三个冒号结束 多行注释

    还可以用这个来打印多行:

    name = ''' because of you '''
    print(name)

    python用户输入:

    age = input("age:")
    print(age)
    print(type(age))

    输入框:输入的密码是密文而不是明文:

    import getpass
    password = getpass.getpass("password")
    print(password)

    python验证用户名和密码:

    username = "admin"
    password = "123456"
    _username = input('username:')
    _password = input('password:')
    if username == _username and password == _password:
        print('welcome login {username}')
    else:
        print('faile to login')

    python while循环

    count = 0
    while True:
        if count >3:
            break
        print(count)
        count += 1

    还可以这样:

    count = 0
    while count<3:
        print(count)
        count += 1
    else:
        print('die no')

    python : for循环

    for i in range(10):
        print(i)

    输出偶数,2是步长:

    for i in range(0,10,2):
        print(i)

    还可以这样:输出每个字母

    for i in 'Python':
        print(i)
  • 相关阅读:
    [转载]Matlab实用小技巧
    Matlab rand randn randint
    Matlab取整
    Mathtype报错:MathType has detected an error in....
    [转载]十大编程算法助程序员走上高手之路
    (转)Free函数的参数一定要是malloc返回的那个指针
    sizeof,一个其貌不扬的家伙(转)
    ISO C Random Number Functions
    srand() rand() time(0)
    IOS之文件夹创建、删除,图片在本地的保存和加载
  • 原文地址:https://www.cnblogs.com/e0yu/p/9273951.html
Copyright © 2011-2022 走看看