งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

VARIABLES, EXPRESSION and STATEMENTS. Values and Data Types Value เป็นสิ่งพื้นฐาน มีลักษณะเป็น ตัวอักษร หรือ ตัวเลข อาทิ 2+2 หรือ “Hello world” Value.

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "VARIABLES, EXPRESSION and STATEMENTS. Values and Data Types Value เป็นสิ่งพื้นฐาน มีลักษณะเป็น ตัวอักษร หรือ ตัวเลข อาทิ 2+2 หรือ “Hello world” Value."— ใบสำเนางานนำเสนอ:

1 VARIABLES, EXPRESSION and STATEMENTS

2 Values and Data Types Value เป็นสิ่งพื้นฐาน มีลักษณะเป็น ตัวอักษร หรือ ตัวเลข อาทิ 2+2 หรือ “Hello world” Value เหล่านี้จำแนกได้เป็นหลาย class หรือ หลาย data type ที่แตกต่างกัน อาทิ 4 เป็นจำนวนเต็ม integer ส่วน “Hello world!” เป็นสายอักขระ string Python มีฟังก์ชัน ช่วยในการจำแนก class ของ value

3

4 Strings belong to the class str. Integers belong to the class int.

5 Numbers with a decimal point belong to the class float.

6 At this stage, you can treat the words class and type interchangeably

7 The value looks like number, but it is in quotation marks like string.

8 Strings in Python can be enclosed in either single quotes (‘) or double quote (“), or three of each (’’’) or (”””).

9 Triple quoted strings can even span multiple lines.

10 Python doesn’t care whether you use single or double or triple quotes. But when interpreter wants to display a string. It has to decide which quotes to use to make it look like a string.

11 Variables Variable is a name that refers to a value 20 number hello greeting 30.5 score

12 what?3.1415917 messagenpi

13 We use variables in a program to “remember” things. But variables are variable. This mean they can change over time. thursday day 21 day

14 17 n n is assigned 17 n gets the value 17 Don’t say “n equals 17”

15 Variable Name ความยาวไม่จำกัด ใช้ได้ทั้งตัวอักษร และตัวเลข ขึ้นต้นด้วยตัวอักษร หรือ _ Case sensitive ใช้ตัวพิมพ์ใหญ่ได้ แต่ไม่นิยม

16

17 Statement เป็นคำสั่งที่ python interpreter สามารถ กระทำการ อาทิ – Assignment statement – while statement – if statement – import statement

18 Evaluating expression เป็นการนำ value, variable, operator และ calls to function มาใช้ รวมกัน

19 Operators and Operands Operator เป็น token พิเศษที่ใช้แทนการ คำนวณ Operand เป็น value ที่ operator ใช้ Division operator / ให้ผลลัพธ์เป็น floating point Floor division operator // ให้ผลลัพธ์เป็นจำนวนเต็ม ปัด เศษทิ้ง

20

21

22

23 Type converter function

24

25 Order of operations วงเล็บ เอ็ก โพเนนท์ คูณ หาร บวก ลบ

26 Operation on strings

27 Input

28 Composition Compose two lines into a single line of code.

29 Composition Compose two lines into a single line of code.

30 Composition Compose two lines into a single line of code.

31 Modulus operator


ดาวน์โหลด ppt VARIABLES, EXPRESSION and STATEMENTS. Values and Data Types Value เป็นสิ่งพื้นฐาน มีลักษณะเป็น ตัวอักษร หรือ ตัวเลข อาทิ 2+2 หรือ “Hello world” Value.

งานนำเสนอที่คล้ายกัน


Ads by Google