Flashield's Blog

Just For My Daily Diary

Flashield's Blog

Just For My Daily Diary

Author : ZhuangBin

06.exercise-strings-and-dictionaries【练习:字符串及字典】

Python Home Page Try It Yourself You are almost done with the course. Nice job. Fortunately, we have a couple more interesting problems for you before you go. As always, run the setup code below before working on the questions. 自己尝试一下 您即将完成课程。 不错的工作。 幸运的是,在您出发之前,我们还为您准备了一些更有趣的问题。 与往常一样,在解决问题之前运行下面的设置代码。 from learntools.core import binder; binder.bind(globals()) from learntools.python.ex6 import * print('Setup […]

06.course-strings-and-dictionaries【字符串及字典】

This lesson will cover two essential Python types: strings and dictionaries. 本课程将介绍两种基本的 Python 类型:字符串和字典。 Strings 字符串 One place where the Python language really shines is in the manipulation of strings. This section will cover some of Python’s built-in string methods and formatting operations. Such string manipulation patterns come up often in the context of data […]

05.exercise-loops-and-list-comprehensions【练习:循环及列表推导式】

This notebook is an exercise in the Python course. You can reference the tutorial at this link. Try It Yourself With all you’ve learned, you can start writing much more interesting programs. See if you can solve the problems below. As always, run the setup code below before working on the questions. 自己尝试一下 有了所学的知识,您就可以开始编写更有趣的程序了。 看看你能否解决下面的问题。 […]

05.course-loops-and-list-comprehensions【循环及列表推导式】

Loops Loops are a way to repeatedly execute some code. Here’s an example: 循环 循环是重复执行某些代码的一种方式。 这是一个例子: planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune'] for planet in planets: print(planet, end=' ') # print all on same line Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune The for loop specifies the variable name to […]

04.exercise-lists【练习:列表】

This notebook is an exercise in the Python course. You can reference the tutorial at this link. Try It Yourself Things get more interesting with lists. See if you can solve the questions below. Remember to run the following cell first. 自己尝试一下 有了列表,事情就变得更有趣了。 看看你能否解决下面的问题。 请记住首先运行以下单元格。 from learntools.core import binder; binder.bind(globals()) from learntools.python.ex4 import * print('Setup […]

04.course-lists【列表】

Lists Lists in Python represent ordered sequences of values. Here is an example of how to create them: 列表 Python 中的列表表示有序的值序列。 以下是如何创建它们的示例: primes = [2, 3, 5, 7] We can put other types of things in lists: 我们可以将其他类型的事物放入列表中: planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune'] We can even make a list of […]

exercise-booleans-and-conditionals【练习:布尔值及条件语句】

This notebook is an exercise in the Python course. You can reference the tutorial at this link. Try It Yourself Think you are ready to use Booleans and Conditionals? Try it yourself and find out. To get started, run the setup code below before writing your own code (and if you leave this notebook and […]

booleans-and-conditionals【布尔值及条件语句】

Booleans Python has a type of variable called bool. It has two possible values: True and False. 布尔值 Python 有一种称为bool的变量类型。 它有两个可能的值:True和False。 x = True print(x) print(type(x)) True Rather than putting True or False directly in our code, we usually get boolean values from boolean operators. These are operators that answer yes/no questions. We’ll go through […]

exercise-functions-and-getting-help【练习:函数】

This notebook is an exercise in the Python course. You can reference the tutorial at this link. Try It Yourself Functions are powerful. Try writing some yourself. As before, don’t forget to run the setup code below before jumping into question 1. 自己尝试一下 函数功能强大。 尝试自己写一些。 和以前一样,在进入问题 1 之前,不要忘记运行下面的设置代码。 # SETUP. You don't need to worry […]

functions-and-getting-help【函数和获取帮助】

You’ve already seen and used functions such as print and abs. But Python has many more functions, and defining your own functions is a big part of python programming. In this lesson, you will learn more about using and defining functions. 您已经看到并使用了诸如print和abs之类的函数。但是Python具有更多功能,定义自己的函数是Python编程的重要组成部分。 在本课程中,您将了解有关使用和定义函数的更多信息。 Getting Help You saw the abs function in the previous tutorial, but […]

Scroll to top