
python
文章平均质量分 64
记录Python的学习历程
清风自在 流水潺潺
喜欢学习和分享,欢迎关注,一起进步!
展开
-
pycharm安装 numpy 库时出现 error occurred when installing package “numpy“以及解决办法
今天网上复制了一个代码,其中有个 import numpy as np,运行时提示需要安装 numpy 库,然后我按照网上的方法,按顺序点击 File --> Settings --> Project: pythonProject --> Python Interpreter ,然后找到 + 那里准备添加库,如下: 然后就报error occurred when installing package "numpy" 的错误,搞了半天都没搞定,遂找了一个经......原创 2022-04-07 20:16:50 · 25810 阅读 · 27 评论 -
python中的提示和传递
这是学习python的第11课,主要学习了python中提示与传递,也就是通过input(),进行一些简单的人机对话。from sys import argvscript,user_name = argvprompt = '> 'print(f"Hi {user_name}, I'm the {script} script.")print("I'd like to as...原创 2018-10-31 20:38:02 · 405 阅读 · 0 评论 -
python中更多种类的打印
这是学习python的第7课,我学习到了python中更多种类的打印方法。1.print("." * 10) 是输出10个 "." , 把每个字母相加输出就可以得到相应的字符串。print("Mary had a little lamb.")print("Its fleece was white as {}." .format('snow')) #将snow放入字符串的相应位置...原创 2018-10-21 20:56:47 · 615 阅读 · 0 评论 -
python中参数、解包和变量
这是学习python的第10课,主要学习了另外一种将变量传递给脚本的方法,也就是用 argv 来传递变量。from sys import argv#read the WYSS section for how to run thisscript,first,second,third = argvprint("The script is called:", script)pri...原创 2018-10-28 18:07:04 · 962 阅读 · 0 评论 -
python中的input()用法
这是学习python的第9课,主要学习了使用python中的 input() 函数,把数据读到自己的程序里去。print("How old are you?",end=' ')age = input()print("How tall are you?",end=' ')height = input()print("How much do you weight?",end=' ...原创 2018-10-28 15:10:28 · 39910 阅读 · 3 评论 -
python中转义序列
这是学习python的第8课,主要学习了python中转义序列的用法。知识要点:1:使用反斜杠(\)可以将难录入的字符放到字符串中。2:将单引号(')和双引号(")添加进入字符串中的方法。<1>"I am 6'2\" tall." // 将字符串中的双引号转义<2>‘I am 6\'2" tall.' //将字符串中的单引号转义...原创 2018-10-28 12:31:17 · 1531 阅读 · 2 评论 -
python中的字符串和文本
这是学习python的第6课,主要是讲 .format()的用法,.format()就是把前后两个字符串连接起来的。types_of_people = 10x = f"There are {types_of_people} types of people." #将types_of_people自变量放入在其中binary = "binary"do_not = "don't"y...原创 2018-10-19 19:53:47 · 403 阅读 · 0 评论 -
python中更多变量的打印
python学习的第5课,这次我学会了如何创建嵌入变量内容的字符串。要在字符串里嵌入变量,需要用到 { },把变量放在里面,字符串要用f开头,f是“格式化”(format)的意思,例如 f"Hello {somevar}",就是把somevar变量里面的东西放到对应字符串中出现的位置。my_name = 'Zed A. Shaw'my_age = 35 # not a liemy_he...原创 2018-10-19 18:48:12 · 588 阅读 · 0 评论 -
python中的变量和命名
python的第四课,学习python的变量和命名规则我们知道,在编程中,好的变量名可以让我们的程序读起来更像是自然语言,所以说变量的命名规则还是蛮重要的。cars = 100space_in_a_car = 4.0drivers = 30passengers = 90cars_not_driven = cars - driverscars_driven = driversca...原创 2018-10-19 17:29:02 · 223 阅读 · 0 评论 -
python的入门程序--Hello World
入门级程序啦,Hello world!print(&amp;amp;amp;amp;quot;Hello World!&amp;amp;amp;amp;quot;)print(&amp;amp;amp;amp;quot;Hello again&amp;amp;amp;amp;quot;)print(&amp;amp;amp;amp;quot;I like typing this.&amp;am原创 2018-10-18 20:21:17 · 182 阅读 · 0 评论 -
python中的注释和#号
python第二课,了解一下python中注释的用法 # A comment,this is so you can read your program laterself. # Anything after the # is ignored by python.print(&amp;amp;quot;I could have code like this.&amp;amp;quot;) # and the comment after...原创 2018-10-19 16:34:19 · 2464 阅读 · 0 评论 -
python中的数字和数学计算
学python的第三课,主要学习python中的数字符号和进行数学计算的方法print("I will now count my chickens:")print("Hens",25+30/6)print("Roosters",100-25*3%4)print("Now I will count the eggs:")print(3+2+1-5+4%2-1/4+6)print("I...原创 2018-10-19 16:54:55 · 430 阅读 · 0 评论