摘要:
#字典增删操作 阅读全文
摘要:
list删值:pop/remove/del/clear 可迭代对象:可以被for循环执行的对象:字符串、列表、元组 阅读全文
摘要:
#列表转字符串(字符串加数字): li = [11, 22, 33, "asd", "xyz", "879", "hello"] s = "" for item in li: s = s + str(item) print(s) #列表转字符串(只有字符串): li = ["ety", "xyz", "hello", "world"] s = "".join(li) print(... 阅读全文
摘要:
value = "5+9" v1,v2 = value.split('+') v3 = int(v1) # print(int(v1)) print(type(v3)) print(type(v2)) 阅读全文
摘要:
死循环: while 1==1: print('ok',time.time) 字节: UTF8:中文3字节 GBK:中文2字节 input() input输入类型都是字符串 字符串转换为数字: n = input() new_n = int(n) continue: 终止当前循环,进行下一次循环 break: 跳出当前全部循环 name = “michael jor... 阅读全文
摘要:
#字符串(1、3个单双引号引起来):name = 'i' name = "am" name = '''a''' name = """worker""" 加法: n1 = "he" n2 = "is" n3 = "smart" n4= n1 + n2 + n3 乘法:... 阅读全文