Discrete

Plan your website and create the next important tasks for get your project rolling

Get Started. It's Free
or sign up with your email address
Discrete by Mind Map: Discrete

1. ตัวดำเนินการทางคณิตศาสตร์ (Operator)

1.1. +

1.1.1. การบวก

1.2. -

1.2.1. การลบ

1.3. *

1.3.1. การคูณ

1.4. /

1.4.1. การหาร

1.5. //

1.5.1. หางเอาจำนวนเต็ม

1.6. %

1.6.1. หารเอาเศษ

1.7. **

1.7.1. ยกกำลัง

2. ตรรกศาสตร์ (Logic)

2.1. ตัวดำเนินการเปรียบเทียบ  (Comparison Operators)

2.1.1. เครื่องหมายน้อยกว่า (<)

2.1.2. เครื่องหมายน้อยกว่าหรือเท่ากับ (<=)

2.1.3. เครื่องหมายมากกว่า (>)

2.1.4. เครื่องหมายมากกว่าหรือเท่ากับ (>=)

2.1.5. เครื่องหมายเท่ากับ (==)

2.1.6. เครื่องหมายไม่เท่ากับ (!=)

2.1.7. in (เป็นการเก็บค่าแบบกลุ่ม)

2.2. ตัวดำเนินการทางตรรกศาสตร์

2.2.1. นิเสธ (Not)

2.2.1.1. print(not p)

2.2.2. Conjunction (AND)

2.2.2.1. print(p and q)

2.2.3. Disjunction (OR)

2.2.3.1. print(p or q)

2.2.4. Exclusive-OR (XOR)

2.2.4.1. print(p ^ q)

2.2.5. Implication (IMPLIES)

2.2.5.1. print((not p) or q)

2.2.6. Biconditional (IFF)

2.2.6.1. print(not(p ^ q))

3. การตัดสินใจแบบมีเงื่อนไข

3.1. if

3.1.1. คำสั่ง if ใช้สำหรับตัดสินใจว่าจะทำคำสั่งภายใต้เงื่อนไขที่กำหนf

3.2. if…else

3.2.1. คำสั่ง else จะอยู่หลังจากช่วงการทำงานของ if คำสั่งภายใต้ else จะทำงานเมื่อเงื่อนไขที่กำหนดในคำสั่ง if เป็นเท็จ

3.3. if…elif

3.3.1. คำสั่ง elif เป็นคำสั่งที่ใช้สำหรับในกรณีที่มีผู้ใช้มีหลายเงื่อนไข คำสั่ง elif จะทำให้การเขียน if else มีรูปแบบที่สั้นลง

3.4. การใช้ if else ร่วมกับ and , or

3.4.1. if a > 6 and a < b:

3.4.2. elif a < 12 or a > b:

4. เซต (Set)

4.1. Content

4.2. Personality

4.3. Positioning

5. ฟังก์ชัน (Function)

5.1. การใส่ข้อมูลผ่านแป้นพิมพ์  (Input data from keyboard)

5.1.1. data1 = input('Input Data from keyboard (Integer):')

5.2. การเปลี่ยนชนิดข้อมูล

5.2.1. int(data1)

5.3. การสร้างฟังก์ชัน (Defined Function)

5.3.1. def function_name ( [ Argument ] ) :

5.4. ตัวอย่างฟังก์ชันที่ Python เตรียมไว้ให้

5.4.1. การหาค่าสัมบูรณ์ (absolute value)

5.4.1.1. print(abs(-6.5))

5.4.2. จำนวนที่น้อยที่สุด (smallest values)

5.4.2.1. print(min(a, b, c))

5.4.3. จำนวนที่มากที่สุด (largest values)

5.4.3.1. print(max (a, b, c))

5.4.4. กำหนดจำนวนตัวเลขทศนิยม            (specified number of digits)

5.4.4.1. print(round(2559.1234, 0))

5.4.5. หาผลรวมทั้งหมดในชุดข้อมูล           (adds numbers in a sequence)

5.4.5.1. print(sum((a, b, c)))

5.4.6. range หรือช่วงของข้อมูลตัวเลข

5.4.6.1. print(list(range(5)))