Day1

Pycharm的使用

是用来写代码的一个工具。

常用的快捷键

可以通过鼠标点击或快捷键。

  • 格式化代码:Ctrl + Alt + L
  • 运行代码:Ctrl + Shift + F10
  • 注释代码:Ctrl + /

交互式开发与编程式开发的区别

交互式开发

  • IDLE
  • cmd -> python / ipython
  • pycharm -> Console

编程式开发(简单理解为是否有print的区别)

Demo

下面是代码模板

a = 1
b = a
print(a == b)

a = 1
b = a
print(a == b)

public static void main(string args[]){
    System.our.print("hello world")
}

public static void main(string args[]){
System.our.print(“hello world”)
}

python 基础

-缩进

python用缩进而不是{}表示程序块

-解释

用#或者‘’‘

-变量与对象

变量位于栈内存
对象位于堆内存

-***

课堂程序

对象三组成:id,type,value

#行连接符
a="abcde\
def"

a


#对象三组成:id,type,print
a=3  #a是一个变量,3是一个对象
print(a)
print(id(a))
print(type(a))

b="我爱你"
print(type(b))  #注意这里print的用法
print(id(b))
print(b)

help()  #help可以请求帮助,执行以后输入keywors可以查到关键字列表

a,b=3,5
c=d=6
print(a)
del(a) 
#删除不再使用的变量,如果对象没有变量引用,就会被垃圾回收器回收,清空内存空间

五环绘制

import turtle

turtle.color("blue")
turtle.circle(100)

turtle.penup()
turtle.goto(250,0)
turtle.color("black")
turtle.pendown()
turtle.circle(100)

turtle.penup()
turtle.goto(500,0)
turtle.color("red")
turtle.pendown()
turtle.circle(100)

turtle.penup()
turtle.goto(125,-100)
turtle.pendown()
turtle.color("yellow")
turtle.circle(100)

turtle.penup()
turtle.goto(375,-100)
turtle.pendown()
turtle.color("green")
turtle.circle(100)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值