or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
9/13 第一堂社課
今日講師:R緯
(Python班)
今日課程主題:
基本輸入輸出
Basic input & output
資料型別(型態)
Type
基本輸入輸出
Basic input & output
輸出
output
「Hello, World!」程式通常指輸出或顯示「Hello, World!」字串的電腦程式。可以用來展示該程式語言的基本語法。
「Hello, World!」是初學者學習某種程式語言所接觸的第一個程式內容,。
第一個程式:
output:
print()簡單直觀
其他程式語言:
JavaScript
(這幾頁絕對不是水時間用的)
Java
(這幾頁絕對不是水時間用的)
C++
(這幾頁絕對不是水時間用的)
Assembly(組合語言)
(這幾頁絕對不是水時間用的)
例題一

print()的參數
其中只有sep和end常用
sep: 分開不同資料
預設為 sep = " " (space)
output:
end: 資料結尾
預設為 end = "\n" (換行)
output:
例題二

輸入
input
input()
output:
()內為等待輸入時,系統輸出的東西
output:
輸入後的所有東西,
預設皆為字串(str)
資料型別(型態)
Type
型別:一個資料的型態、類別
Python中內建了很多型別
我們只要會用其中四個
詳細:Python官方
我們能用type()查看型別
output:
其中int, float, bool皆可拿來運算
(bool的運算比較特別)
float能轉int,int也能轉float
output:
str的使用
所有型別都能轉成str
output:
str是純數字時可轉成int, float
output:
str長度、取出字元
END
(總計:34面簡報、377行Markdown、5191個字元)