随笔分类 - Python 3程序开发快速指南 笔记
摘要:2.7.1 print_unicode.py 1 import sys 2 import unicodedata 3 4 def print_unicode_table(word,word2): 5 print("decimal hex chr {0:^30}".format("name")) 6 print("------- ----- --- {0:-<30}".format("")) 7 8 code = ord(" ") 9 end = sys.maxunicode10 11 wh
阅读全文
摘要:只是做了一部分,没有全部做,有的题目,2题合并为一题了。1.1View Code 1 numbers = [] 2 count = 0 3 sum = 0 4 mean = 0 5 6 while True: 7 try: 8 line = input("enter a number or Enter to finish:") 9 if line: 10 num = int(line) 11 if num not in numbers: 12 numbers.append(num) 13 count += 1 14 sum += num 15 else: 16 break
阅读全文
摘要:1.1 创建并运行Python程序 1.2 Python的关键要素 数据类型 : int; str:字符索引从 0 开始. Python中基本的数据类型是固定的。python中字符类型就是长度为1的字符串。 Eg:mystr = “Hello,World!” mystr[0] = ‘M’ #error 对象引用:objectReference = value,当一个数据没有被任何对象引...
阅读全文
浙公网安备 33010602011771号