-
L = ['Adam', 'Lisa', 'Paul', 'Bart'] #L.pop(0) L.pop(3) L.pop(2) print L查看全部
-
L = ['Adam', 'Lisa', 'Bart'] L.append('iGreenMind') L.insert(2,'Paul') print L查看全部
-
L = [95.5,85,59] print L[-1] print L[-2] print L[-3] print L[-4]查看全部
-
L = ['Adam', 95.5, 'Lisa', 85, 'Bart', 59] print L classmates = ['Michael', 'Bob', 'Tracy'] print classmates L = ['Michael', 100, True] print L; empty_list = [] print empty_list查看全部
-
print 2.5 + 10.0 / 4 print "2.5 + 10.0 / 4 =",2.5 + 10.0 / 4 print 1 + 2 + 3 # ==> 6 print 4 * 5 - 6 # ==> 14 print 7.5 / 8 + 2.1 # ==> 3.0375查看全部
-
# -*- coding: utf-8 -*- print u'''???''' print '我骄傲\n中文\n日文' print u''' 我 名字 叫 iGreenMind ''' print ur'''Python的Unicode字符串支持"中文", "日文", "韩文"等多种语言''' print u'''静夜思\n 床前明月光, 疑是地上霜。 举头望明月, 低头思故乡。'''查看全部
-
print r'\(~_~)/ \(~_~)/' print r'''"To be, or not to be": that is the question. Whether it's nobler in the mind to suffer.''' print r'''Python is created by "Guido". It is free and easy to learn. Let's start learn Python in imooc!'''查看全部
-
r = 'Python was started in 1989 by "Guido".' print r s = "Python is free and easy to learn." print s; t = 'Bob said "I\'m OK".' print t; x = 'Bob said \"I\'m OK\".' print x;查看全部
-
在Python中常用的转义字符有: \n 换行 \t 一个制表符 \\ 表示转义字符\本身查看全部
-
a =123 print a; a = 'iGreenMind'; print a; a = 'abc' print a; b =a; print b; a = 'xyz' print b; print a; x1 = 1 d = 3 n = 100 x100 = 1 + d*(100-1) print x100 s = 100*(1 + x100)/2 print s查看全部
-
等差数列第n个数字如此表示: xn = 1 + d*(n-1) s = n*(x1 + xn)/2查看全部
-
如果某种编程语言中的变量的数据类型不固定,是可变的,那么就称这种变量不固定数据类型的语言为动态语言。查看全部
-
在Python中,可以把任意数据类型赋值给变量。 同一个变量可以反复赋值,而且可以是不同类型的变量。查看全部
-
关于Python代码中的注释的知识点有: 1,单行注释: # 2,多行注释 ''' 多行注释语句 多行注释语句 ''' 3,中文注释,需要在代码首部输入以下代码: #coding=utf-8 或者 #-*- coding: utf-8 -*-查看全部
-
#coding=utf-8 #-*- coding: utf-8 -* #print 'hello' # #-*-coding:utf-8-* # -*- coding:utf-8 -* 这是一行中文注释! ''' 这是多行注释 这是多行注释 '''查看全部
举报
0/150
提交
取消