基础
文章平均质量分 61
沃柑好吃
这个作者很懒,什么都没留下…
展开
-
Python练习题最长路径问题(字典)
昨天有一个留学生朋友问了我一到python题,题目如下: Besides a function to generate a random dictionary,defines two functions that analyse a dictionary.See the pdf for explanations via an illustrationand examples of possible uses.原创 2022-06-17 23:59:57 · 843 阅读 · 1 评论 -
Python按顺序输出三个整数
一个很简单的问题,有学弟学妹问我,记录一下。 总体思想就是创建一个空列表然后循环输入数字,最后用sort() 排序输出。 l = [] # 建立一个空列表 while len(l) < 3: # 判断列表里数量 l.append(int(input())) # 循环三次输入数字,并加入列表 l.sort() # sort()列表排序,默认从小到大 for i in l: # 遍历排序后的列表 print(i) # 输出 ...原创 2022-04-02 15:53:54 · 2805 阅读 · 0 评论