摘要:
{1,2,3,4,5,6} - {3,4} {1, 2, 5, 6} {1,2,3,4,5,6}+{3,4} Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unsupported o 阅读全文
posted @ 2022-05-27 22:07
repinkply
阅读(16)
评论(0)
推荐(0)
摘要:
1.在python中怎么样定义一个元素的元祖? print(type((1))) print(type(('a'))) 以上这样定义,( 会被编译器解释为 运算符中的左括号。 需要以下这样定义: print(type((1,))) print(type(('a',))) 那么怎么定义一个空元祖呢?按 阅读全文
posted @ 2022-05-27 20:49
repinkply
阅读(75)
评论(0)
推荐(0)
摘要:
1.字符串中r字母的作用 print('c:\northwind\northwest') print('c:\\northwind\\northwest') print(r'c:\northwind\northwest') # 在字符串前面加入r,就不是一个普通字符串,而是一个原始字符串(即所见即所 阅读全文
posted @ 2022-05-27 15:18
repinkply
阅读(20)
评论(0)
推荐(0)
摘要:
bin(...) 函数可以实现其他进制向二进制的转化。 1.十进制转化为二进制 print(bin(10)) #输出0b1010 2.八进制转化为二进制 print(bin(0o7)) #输出0b111 3.十六进制转化为二进制 print(bin(0xE)) int(...) 函数可以实现其他进制 阅读全文
posted @ 2022-05-27 12:27
repinkply
阅读(132)
评论(0)
推荐(0)

浙公网安备 33010602011771号