练习基本输入输出:

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开发环境设置与熟悉。相关推荐

  1. 【教程】Windows下Miniconda+Pytorch+Pycharm开发环境搭建指南

    Windows下Miniconda+Pytorch+Pycharm开发环境搭建指南 给本科生写的新手教程,遇到很多新手的共性问题,可供大家参考.在开始阅读之前,请注意两个要关键:1.为什么要使用Con ...

  2. JDeveloper开发环境设置

    2019独角兽企业重金招聘Python工程师标准>>> Environment Encoding设置成UTF-8 Compiler Encoding设置成UTF-8 设置运行目录 打 ...

  3. Hadoop Eclipse开发环境设置

    1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0 ...

  4. Hadoop集群_Eclipse开发环境设置

    1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0 ...

  5. Maven开发环境设置导致的异常java.lang.NumberFormatException: null

    Maven开发环境设置导致的异常java.lang.NumberFormatException: null 参考文章: (1)Maven开发环境设置导致的异常java.lang.NumberForma ...

  6. vue-webpack项目本地开发环境设置代理解决跨域问题

    vue-webpack项目本地开发环境设置代理解决跨域问题 参考文章: (1)vue-webpack项目本地开发环境设置代理解决跨域问题 (2)https://www.cnblogs.com/xyyt ...

  7. hadoop搭建与eclipse开发环境设置

    hadoop搭建与eclipse开发环境设置(转) 1.    Windows下eclipse开发环境配置 1.1 安装开发hadoop插件 将hadoop安装包hadoop\contrib\ecli ...

  8. Symbian编程与开发环境设置

    一. symbian/' target='_blank'>Symbian针对不同的终端有不同的开发包,目前多见的是NOKIA的60和80系列Series 60 SDK for symbian/' ...

  9. Python菜鸟在成长——熟悉PyCharm开发环境

    PyCharm是由Jetbrains 公司开发的Python集成开发环境,由于其具有智能代码编辑器,可实现自动代码格式化.代码完成.智能提示.重构.单元测试.自动导入和一键代码导航等功能,目前已成为P ...

最新文章

  1. 交替性注意力_如何从心理学角度解释“专注力”,“专注力”对一个人的影响?...
  2. matlab计算方程fsolve,matlab中关于fsolve解非线性方程组的问题
  3. 用户和组 win2003
  4. bootstrap table 服务器端分页例子
  5. js函数、事件、补充知识
  6. java 接口传数组_Restful接口传递数组参数
  7. php源码 学校版 cms,闪灵CMS学校建站系统(含小程序)
  8. f1c200s核心板_F1C200s NS 2009 驱动
  9. linux netperf,Netperf 的使用与介绍
  10. C++之个人银行账户管理程序(二)
  11. 科技护肤品,买还是不买
  12. 如何通过笔记本共享网络给台式
  13. token与JWT详细介绍
  14. python交互编程模式_进入python交互模式的方法
  15. C语言编程练习:水仙花数
  16. java安装好了打不开机_Java安装以后为什么打不开?java打不开一闪而过如何解决?...
  17. 面试:计算机网络基础详解(一)
  18. ORACLE 获取某一日期所在周的周一
  19. FORMULA ONE RACES AHEAD (F1锦标赛全速前进)
  20. vue 获取公网IP和地理位置

热门文章

  1. JQuery 动态创建表单,并自动提交
  2. 雷观(七):靠谱的程序员,不是随便一个码农就可以做到的
  3. 值得收藏的经典网页代码(1)
  4. codecheck_use_record
  5. 尺度不变特征变换匹配算法详解
  6. php的webservice的wsdl的XML无法显示
  7. 在windows程序中嵌入Lua脚本引擎--使用VS IDE编译Luajit脚本引擎
  8. 【经验】提高github的下载(克隆)速度
  9. 【Qt】设置窗口透明度
  10. m1芯片支持php,M1芯片兼容性怎么样 M1芯片软件兼容好吗