GithubHelp home page GithubHelp logo

kids-python's Introduction

Kids Python

计算机基础

计算机的历史

https://open.163.com/newview/movie/free?pid=MDGEPAQ4K&mid=MDGET74MS https://open.163.com/newview/movie/free?pid=MDGEPAQ4K&mid=MDGET4H0I

计算机的组成

冯诺依曼结构 https://open.163.com/newview/movie/free?pid=NGVEDUL25&mid=AGVEDULCA

CPU/RAM/Disk/IO

个人计算机

平板/手机

冰箱/洗衣机/电饭锅/洗碗机

操作系统

WINDOWS操作系统

WINDOWS系统/MacOS系统/Linux系统

Word/Excel/Powerpoint

控制面板

设备管理器

文件类型

程序

文件操作

增删查改

命令提示符cmd

mkdir C:\workspace\node\blog\Pending\aa echo "C:\workspace\node\blog\Pending\aa\aa.txt">C:\workspace\node\blog\Pending\aa\aa.txt

第一个程序

aa.cmd

路径

网络

Python下载和安装

https://www.python.org/ 环境变量PATH

运行

  1. python 1_hello.py\
  2. IDLE run
  3. VS Code

Indentation

Variables

x = 4       # x is of type int
x = "Sally" # x is now of type str
print(x)

x = str(3)    # x will be '3'
y = int(3)    # y will be 3
z = float(3)  # z will be 3.0

x, y, z = "Orange", "Banana", "Cherry"

fruits = ["apple", "banana", "cherry"]
x, y, z = fruits

Comments

Variable Names

A variable name must start with a letter or the underscore character A variable name cannot start with a number A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ) Variable names are case-sensitive (age, Age and AGE are three different variables) A variable name cannot be any of the Python keywords. 参数 第一个字符必须是字母表中字母或下划线'_'。 标识符的其他的部分有字母、数字和下划线组成。 标识符对大小写敏感。

_a a aA aa aa_5 Aa //5asdf

Python 保留字

>>> import keyword
>>> keyword.kwlist
['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
>>>

标准数据类型

Python 中有六个标准的数据类型:

Number(数字) String(字符串) List(列表) Tuple(元组) Set(集合) Dictionary(字典) Python3 的六个标准数据类型中:

不可变数据(3 个):Number(数字)、String(字符串)、Tuple(元组); 可变数据(3 个):List(列表)、Dictionary(字典)、Set(集合)。

type(x)

字符串

word = '字符串' sentence = "这是一个句子。" paragraph = """这是一个段落, 可以由多行组成"""

kids-python's People

Contributors

prufeng avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.