• python学习之基本类型


    #我的第一个python程序
    print("hello world");
    #多行字符串
    print("""\
    Usage: thingy [OPTIONS]
         -h                        Display this usage message
         -H hostname               Hostname to connect to
    """);
    #转义字符的作用
    print("this \'s book");
    #保留字符串中字符前面加r
    print(r"c:\nbacet");
    #长的字符串显示
    str=("hello jack apple banana"
         "ffdfjejiejije");
    print(str);
    #字符串相加
    print("fff"+"fjjfds");
    print(str[0]);
    #del(str);
    print("ddjdd"+str);
    #del(str);
    #print("ddjdd"+str);
    world="python";
    #print(world[-1]);
    #print(world[-2]);
    #print(world[0:2]);
    print(world[2:]);
    del(world);
    del(str);
    s=("ddddd");
    print(len(s));
    del(s);
    #数组的运用
    m=[1,2,3,5,6,7];
    n=[m,43,45,67,76];
    print(n[0][1]);
    print(m);
    z=m+n;
    print(z);
    m[0]=9;
    print(m);
    #copy 一个新的数组
    print(m[:]);
  • 相关阅读:
    指针
    Centos6.5 安装Vim7.4
    C++ Prime:指针和const
    C++ Prime:const的引用
    C++ Prime:函数
    C++ Prime:范围for语句
    python的oop概述
    脚本单独调用django模块
    xtrabackup备份之xbstream压缩
    MySQL8.0安装
  • 原文地址:https://www.cnblogs.com/airven/p/4937958.html
Copyright © 2020-2023  润新知