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[:]);
原文地址:https://www.cnblogs.com/airven/p/4937958.html