四十二岁大爷零基础学python,以此贴鼓励自己能坚持下去
虽然年龄有点大,还是希望自己可以坚持下去 本帖最后由 天开门 于 2025-5-11 23:45 编辑5月8日学习日志整理:
1、while循环语句的应用
2、 import random 调用函数
3、random randint(1,10)生成随机数
4、break终止直接结束。
没看明白:random.setstate(x)随机数重现的原理是什么?
5月9日今日学习:
1布尔运算 (ture/flase)的条件
2逻辑运算(短路逻辑、运算符优先级)
3流程图
4思维导图
感觉流程图和思维导图有点难
5月10日:
1、分支结构和分支结构的嵌套if else的5种用法及例子
2、while的循环结构及嵌套。break continue的打断(仅能打断当前循环)
3、For循环结构及range的应用for 变量 in 可迭代对象range
问题:最后的例子中如果数值扩大到12 可以2*6和3*4 该程序仅能跑到2*6就要退出,不完美。
5月11日:
1、创建、访问列表
2、append、extend、s、s.insert(1,2)、remove、pop()、clear()的用法
给42岁初学者的Python学习加油帖
兄弟,年龄根本不是问题!我见过50+转行编程的成功案例,你的学习之路才刚刚开始[拳头]
零基础学习建议:
[*]先搞懂 print("Hello World!") 这类基础语法
[*]每天坚持写20行代码,比一次学3小时更有效
[*]从 FishC教程]https://fishc.com.cn]FishC教程 找适合新手的项目练手
[*]遇到报错先截图记录,这是进步的脚印
推荐学习路线:
1. Python基础语法(1-2个月)
2. 常用库如requests/pandas(1个月)
3. 做个实际小项目(如天气查询工具)
4. 参与开源项目或接小型开发任务
# 举个简单例子,保持代码乐趣
import random
luck_number = random.randint(1,100)
print(f"今日幸运数字:{luck_number}")
坚持不下去时记得:
→ 每行代码都是对抗年龄偏见的子弹
→ 编程思维比记忆语法更重要
→ 完成比完美更重要
FishC论坛的《零基础入门学习Python》系列视频非常适合起步,遇到问题随时来问。你今天的坚持,就是给十年后的自己最好的礼物![茶杯]
以上回复来自 FishC AI 小助理,如未能正确解答您的问题,请继续追问。 {:5_108:} 加油年龄不是问题 加油 天开门 发表于 2025-5-8 10:56
5月8日学习日志整理:
1、while循环语句的应用
2、 import random 调用函数
遇到不懂的函数,可以使用 Python 的 help():
Python 3.12.5 (tags/v3.12.5:ff3bc82, Aug6 2024, 20:45:27) on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> help()
Welcome to Python 3.12's help utility! If this is your first time using
Python, you should definitely check out the tutorial at
https://docs.python.org/3.12/tutorial/.
Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.To get a list of available
modules, keywords, symbols, or topics, enter "modules", "keywords",
"symbols", or "topics".
Each module also comes with a one-line summary of what it does; to list
the modules whose name or summary contain a given string such as "spam",
enter "modules spam".
To quit this help utility and return to the interpreter,
enter "q" or "quit".
help> random.setstate
Help on method setstate in random:
random.setstate = setstate(state) method of random.Random instance
Restore internal state from object returned by getstate().
help>
这里说的很清楚了,原理是根据 getstate() 返回的对象让 Random 重新回到一个状态。
setstate() 当然能理解 random 自己人 getstate() 返回的对象,就把种子等生成随机数需要用到的东西还原了。 player-none 发表于 2025-5-8 17:33
遇到不懂的函数,可以使用 Python 的 help():
感谢指点 {:5_92:} 本帖最后由 天开门 于 2025-5-9 17:09 编辑
5月9日今日学习:
1布尔运算 (ture/flase)的条件
2逻辑运算(短路逻辑、运算符优先级)
3流程图
4思维导图
感觉流程图和思维导图有点难 差不多的年龄自学,坚持是唯一动力。 加油!
同龄人!
页:
[1]