Pycharm开发环境设置与熟悉。
练习基本输入输出:
print('你好,{}.'.format(name))
print(sys.argv)
库的使用方法:
import ...
from ... import ...
条件语句:
if (abs(pos()))<1:
break
循环语句:
for i in range(5):
while True:
函数定义:
def mygoto(x,y):
def drawjx(r):
综合练习:画一面五星红旗,将代码与运行截图发布博客交作业。
import turtledef mygoto(x, y):turtle.up()turtle.goto(x, y)turtle.down()def drawF(x):turtle.begin_fill()for i in range (5):turtle.forward(x)turtle.right(144)turtle.end_fill()turtle.setup=(600, 400, 0, 0) turtle.color("yellow") turtle.bgcolor('red') turtle.fillcolor("yellow")mygoto(-270, 120) drawF(120)for i in range(4):x=1if i in [0, 3]:x=0mygoto(-120+x*30,150-i*40)turtle.left(15-i*15)drawF(30)mygoto(0, 0) turtle.hideturtle() turtle.done()
字符串练习:
http://news.gzcc.cn/html/2017/xiaoyuanxinwen_1027/8443.html
取得校园新闻的编号
str = "http://news.gzcc.cn/html/2017/xiaoyuanxinwen_1027/8443.html" num = str.rstrip(".html").split("_")[1] print(num)
https://docs.python.org/3/library/turtle.html
产生python文档的网址
str1 = "https://docs.python.org/3.6/library/" str2 = ".html" str =str1+"turtle"+str2 print(str)
http://news.gzcc.cn/html/xiaoyuanxinwen/4.html
产生校园新闻的一系列新闻页网址
for i in range(2,10):str = "http://news.gzcc.cn/html/xiaoyuanxinwen/{}.html".format(i)print(str)
练习字符串内建函数:strip,lstrip,rstrip,split,count,replace
用函数得到校园新闻编号
用函数统计一歌词(文章、小说)中单词出现的次数,替换标点符号为空格,用空格进行分词。
str = ''' I'm hurting, baby, I'm broken down I need your loving, loving, I need it now When I'm without you I'm something weak You got me begging Begging, I'm on my knees I don't wanna be needing your love I just wanna be deep in your love And it's killing me when you're away Ooh, baby, 'Cause I really don't care where you are I just wanna be there where you are And I gotta get one little taste Your sugar Yes, please Won't you come and put it down on me I'm right here, 'cause I need Little love and little sympathy Yeah you show me good loving Make it alright Need a little sweetness in my life Your sugar Yes, please Won't you come and put it down on me My broken pieces You pick them up Don't leave me hanging, hanging Come give me some When I'm without ya I'm so insecure You are the one thing The one thing, I'm living for I don't wanna be needing your love I just wanna be deep in your love And it's killing me when you're away Ooh, baby, 'Cause I really don't care where you are I just wanna be there where you are And I gotta get one little taste Your sugar Yes, please Won't you come and put it down on me I'm right here, 'cause I need Little love and little sympathy Yeah you show me good loving Make it alright Need a little sweetness in my life Your Sugar! (Your sugar!) Yes, please (Yes, please) Won't you come and put it down on me Yeah I want that red velvet I want that sugar sweet Don't let nobody touch it Unless that somebody's me I gotta be a man There ain't no other way 'Cause girl you're hotter than southern California Bay I don't wanna play no games I don't gotta be afraid Don't give all that shy shit No make up on, that's my Sugar Yes, please Won't you come and put it down on me (down on me!) Oh, right here (right here), 'Cause I need (I need) Little love and little sympathy Yeah you show me good loving Make it alright Need a little sweetness in my life Your sugar! (Sugar!) Yes, please (Yes, please) Won't you come and put it down on me Your sugar Yes, please Won't you come and put it down on me I'm right here, 'cause I need Little love and little sympathy Yeah you show me good loving Make it alright Need a little sweetness in my life Your sugar Yes, please Won't you come and put it down on me (Down on me, down on me)''' print(str.count("sugar")) print(str.replace(","," "))
转载于:https://www.cnblogs.com/BOXczx/p/8619333.html
Pycharm开发环境设置与熟悉。相关推荐
- 【教程】Windows下Miniconda+Pytorch+Pycharm开发环境搭建指南
Windows下Miniconda+Pytorch+Pycharm开发环境搭建指南 给本科生写的新手教程,遇到很多新手的共性问题,可供大家参考.在开始阅读之前,请注意两个要关键:1.为什么要使用Con ...
- JDeveloper开发环境设置
2019独角兽企业重金招聘Python工程师标准>>> Environment Encoding设置成UTF-8 Compiler Encoding设置成UTF-8 设置运行目录 打 ...
- Hadoop Eclipse开发环境设置
1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0 ...
- Hadoop集群_Eclipse开发环境设置
1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0 ...
- Maven开发环境设置导致的异常java.lang.NumberFormatException: null
Maven开发环境设置导致的异常java.lang.NumberFormatException: null 参考文章: (1)Maven开发环境设置导致的异常java.lang.NumberForma ...
- vue-webpack项目本地开发环境设置代理解决跨域问题
vue-webpack项目本地开发环境设置代理解决跨域问题 参考文章: (1)vue-webpack项目本地开发环境设置代理解决跨域问题 (2)https://www.cnblogs.com/xyyt ...
- hadoop搭建与eclipse开发环境设置
hadoop搭建与eclipse开发环境设置(转) 1. Windows下eclipse开发环境配置 1.1 安装开发hadoop插件 将hadoop安装包hadoop\contrib\ecli ...
- Symbian编程与开发环境设置
一. symbian/' target='_blank'>Symbian针对不同的终端有不同的开发包,目前多见的是NOKIA的60和80系列Series 60 SDK for symbian/' ...
- Python菜鸟在成长——熟悉PyCharm开发环境
PyCharm是由Jetbrains 公司开发的Python集成开发环境,由于其具有智能代码编辑器,可实现自动代码格式化.代码完成.智能提示.重构.单元测试.自动导入和一键代码导航等功能,目前已成为P ...
最新文章
- 交替性注意力_如何从心理学角度解释“专注力”,“专注力”对一个人的影响?...
- matlab计算方程fsolve,matlab中关于fsolve解非线性方程组的问题
- 用户和组 win2003
- bootstrap table 服务器端分页例子
- js函数、事件、补充知识
- java 接口传数组_Restful接口传递数组参数
- php源码 学校版 cms,闪灵CMS学校建站系统(含小程序)
- f1c200s核心板_F1C200s NS 2009 驱动
- linux netperf,Netperf 的使用与介绍
- C++之个人银行账户管理程序(二)
- 科技护肤品,买还是不买
- 如何通过笔记本共享网络给台式
- token与JWT详细介绍
- python交互编程模式_进入python交互模式的方法
- C语言编程练习:水仙花数
- java安装好了打不开机_Java安装以后为什么打不开?java打不开一闪而过如何解决?...
- 面试:计算机网络基础详解(一)
- ORACLE 获取某一日期所在周的周一
- FORMULA ONE RACES AHEAD (F1锦标赛全速前进)
- vue 获取公网IP和地理位置