Flashield's Blog

Just For My Daily Diary

Flashield's Blog

Just For My Daily Diary

Month: January 2024

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 […]

Exercise: Syntax, Variables, and Numbers【练习语法变量和数字】

Exercises Welcome to your first set of Python coding problems! If this is your first time using Kaggle Notebooks, welcome! Notebooks are composed of blocks (called "cells") of text and code. Each of these is editable, though you’ll mainly be editing the code cells to answer some questions. To get started, try running the code […]

Scroll to top