Vu Python
此专栏为本人Vu Python笔记,以week形式记录,会不断完善里面的内容
梦里一声何处鸿
预习笔记&&复习资料
展开
-
Vu Python - 备考宝典
此篇博客注重概念的总结,以及它们的英文表述。来吧,对着PPT抠定义,走起!Topic 2 – Operators and Variables1.What is an expression?An expression is made of operands (values) and operators.表达式由操作数(值)和运算符组成。2.Order of Precedence(优先级...原创 2019-12-20 16:02:34 · 367 阅读 · 0 评论 -
Vu Python week11 - Designed with classes
Week11 - Designed with classes什么class?类是用户定义的数据类型,其中包含属性和方法。类定义事物(对象)的抽象特征,包括其特征(字段或属性)和行为(它可以做的事情或方法)。为什么要用class?因为写一个class以后可以多次调用,一劳永逸。我们可以在一个class下定义多个对象,如果没有写class我们需要对每一个对象进行解释其方法和属性。c...原创 2019-11-28 20:11:39 · 174 阅读 · 0 评论 -
Vu Python week10 - Graphical User Interfaces
Week10 - Graphical User Interfaces本节我们来讲如何用Python做图形用户界面,之前写程序大家也发现在与用户做交互的过程中存在大小写的问题。虽然我们可以用改变大小写的函数方法(upper(),lower())的方法但是这样界面不够友好。例 1 :from tkinter import * #调用tkinter文件中定义的所以类mywindow = Tk()...原创 2019-11-27 21:32:18 · 181 阅读 · 0 评论 -
Vu Python week9 -Turtle Graphics
Week 9 Turtle Graphics本节很有意思,这里主要要掌握一些操作方法。我们先定义一个画笔,t = turtle.Turtle(),则有一下函数:辨:t.setheading()与t.right()和t.left()的区别import turtle # 调用海龟画图的库# 定义setheading画笔t1 = turtle.Turtle()t1.shape("tur...原创 2019-11-26 22:40:41 · 546 阅读 · 0 评论 -
Vu Python week 7 - Lists and Dictionaries
Week 7 list and Dictionaries接着week 6 说list吧1.list的运算例 1 :a = [1,2,3]b = ["whh",7.7]print (a+b)print(a*2)运行结果:[1, 2, 3, 'whh', 7.7][1, 2, 3, 1, 2, 3]解析:由此可见list是可以做加,乘运算的。但是不能做减,除运算。例 2...原创 2019-10-31 22:38:45 · 133 阅读 · 0 评论 -
Vu Python week 6 - Strings and Text files
Week 6基础的东西就不说了,就记一下我觉得值得敲一下的东西吧。1.将print后的默认换行操作自定义修改例:string = "whh"for letter in string: print (letter)运行结果:whh这里print 后的默认操作是换行,现在我们把他修改为空操作符:string = "whh"for letter in string:...原创 2019-10-31 20:28:47 · 140 阅读 · 0 评论 -
Vu python week 3,4 - Selection and Repetition Structures
Week 3,4没啥特别说的知识点,就刷Vu上的文档吧。Lab-4 Nicks2019partAEx1:for count in range (3): print (count)运行结果:012解析:如果括号里为一个数a,则依次输出0-a-1这a个数字。Ex2:for count in range (1,3): print (count)运行结果:1...原创 2019-10-17 22:10:12 · 3380 阅读 · 0 评论 -
Vu Python week2 - Variables
Week 2内容逻辑关联性不强,以随笔形式记录1.强制转换例1 :a = int (input("Please enter a number :"))b = int (input("Please enter a number :"))sum = a+bprint ("a+b="+ str(sum))结果如下:Please enter a number :5Please en...原创 2019-10-09 11:09:10 · 177 阅读 · 0 评论