函数、参数与作用域
函数、参数与作用域 为什么需要函数 函数用于: - 封装重复逻辑。 - 给代码命名。 - 缩小复杂度。 - 方便测试。 参数类型 位置参数: 默认参数: 关键字参数: 可变位置参数: 可变关键字参数: 返回值 没有显式 return 时,函数返回 None 。 作用域 LEGB Python 查找名
迭代器、生成器与装饰器
迭代器、生成器与装饰器 可迭代对象 可以被 for 循环遍历的对象就是可迭代对象。 常见可迭代对象: - list - tuple - dict - set - str - 文件对象 - 生成器 迭代器 迭代器实现了: - iter () - next () 生成器函数 使用 yield 的函数会返
文件、异常与上下文管理
文件、异常与上下文管理 pathlib 优先使用 pathlib.Path 处理路径。 读写文本文件 使用 encoding="utf-8" 可以减少中文乱码。 使用 open 模式: - r :读取。 - w :写入并覆盖。 - a :追加。 - rb :二进制读取。 - wb :二进制写入。 J
John Muir on the Economy of Forests
A TOEFL-level reading passage adapted from John Muir's public-domain nature writing.
Huxley on Reading a Piece of Chalk
A TOEFL-level reading post built from a public-domain excerpt of T. H. Huxley's On a Piece of Chalk.
Darwin on the Struggle for Existence
A TOEFL-level reading post built from a public-domain excerpt of Charles Darwin's On the Origin of Species.
1. 祈使句只有三个人称
1. 祈使句只有三个人称 法语祈使句只用于: 人称 含义 例子 --- --- --- tu 你 Écoute ! nous 我们 Écoutons ! vous 你们 / 您 Écoutez ! 没有 je / il / elle / ils / elles 的祈使形式。 --- 2. 基本变法:
Lesson 1-12 图片选词练习
先选择一个词汇分类,再像百词斩一样一张一张选择对应的法语单词。每次打开页面都会重新随机排序。 返回词汇表 · 打开闪卡 正在加载词卡...
人物、身份、职业
flashcards 返回词汇表 · 图片选词练习 人物、身份、职业 monsieur::先生 madame::女士,夫人 mademoiselle::小姐 ami(e)::朋友 copain/copine::朋友,同伴 garçon::男孩,服务员 fille::女孩,女儿 femme::女人,妻
一、介词是什么?
一、介词是什么? 介词就是放在名词、代词、动词不定式前面,表示关系的词。 比如: Je vais à Paris . 我去巴黎。 Le livre de Marie . Marie 的书。 Il parle avec Paul . 他和 Paul 说话。 介词后面常接: 结构 例子 --- ---