python

307 阅读1分钟

python第一课

python语言优势

  • python少的多的代码写出程序,(缩减代码量)C++/php/java/ruby
  • python应用范围,Linux和macOS自带python解释器;web;3D动画;云计算;企业应用ERP/pro
  • python3常用语法
  • 面向对象编程思维
  • 运用模块进行编程
  • 游戏编程
  • 计算机仿真(模拟器(快速计算结果))
  • 从0开始是所有编程语言约定俗称的

学习的捷径

课后练习fishc.com.cn/forum-243-1…

  • 验证例子
  • 课后实践
  • 擅用搜索
  • 学会放松

change the world by program(让编程改变世界)

  • python下载<www.python.org/>
  • IDLE是一个python Shell,shell的意思就是“外壳”,基本上来说,就是一个通过键入文本与程序交互的途径
  • 代表提示符,等待输入python指令

python第二节课

pycharm证书过期

请问Python如何实现将列表:['a','a','b','a','b','c']输出为字典:{'a':3,'b':2,'c':1}? 方法一

str_list = ['a', 'a', 'b', 'a', 'b', 'c']
dic = {}
for name in str_list:
    result = dic.get(name, -1)
    if result == -1:
        dic[name] = 1
    else:
        dic[name] = dic[name] + 1
print(dic)

方法二

str_list = ['a', 'a', 'b', 'a', 'b', 'c']
dic = {}
for i in str_list:
    if str_list.count(i) >= 1:
        dic[i] = str_list.count(i)
print(dic)

方法三

str_list = ['a', 'a', 'b', 'a', 'b', 'c']
s = set(str_list)
d = dict.fromkeys(s, 0)
for i in s:
    d[i] = str_list.count(i)
print(d)

自动化测试

  • 问题报告对接到相应的人
  • 问题截图
  • 生成报表
  • 发钉钉
  • 录屏