-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
37 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
score = 80 | ||
|
||
if score > 80: | ||
print("so good") | ||
else: | ||
print("sorry") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print("Hello Python") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# 1.ให้เขียนโปรแกรมแสดง รหัสนักศึกษา ชื่อ-นามสกุล และจังหวัดที่อาศัยอยู่ | ||
|
||
student_id = "66143XXX" | ||
full_name = "Pichwach Jantharangsee" | ||
full_name = "Faelayis" | ||
province = "Chiang Mai" | ||
|
||
print("รหัสนักศึกษา:", student_id) | ||
print("ชื่อ-นามสกุล:", full_name) | ||
print("จังหวัดที่อาศัย:", province) | ||
print("รหัสนักศึกษา :", student_id) | ||
print("ชื่อ-นามสกุล: ", full_name) | ||
print("จังหวัดที่อาศัย: ", province) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
#การแสดงอายุ | ||
age = 20 | ||
|
||
print("อายุ:", age) | ||
print("อายุ: ", age) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 5.ให้ตอบคำถามต่อไปนี้ ว่าชื่อตัวแปรที่กำหนดถูกหรือผิด ถ้าผิดเพราะอะไร | ||
|
||
# GPA ถูก | ||
# _ProgramPthon ถูก | ||
# Num 123 ผิด ไม่ควรมีเว้นวรรคในชื่อตัวแปรและไม่ควรขึ้นต้นด้วยตัวเลข: Num123 ถูกต้อง | ||
# email@cmru ผิด ไม่สามารถใช้ @ เป็นส่วนหนึ่งของชื่อตัวแปรได้ | ||
# 64122456ID ผิด ตัวแปรไม่ควรขึ้นต้นด้วยตัวเลข |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 6.ให้เขียนโปรแกรมหาพื้นที่สามเหลี่ยม เมื่อกำหนดให้ ค่าฐานเท่ากับ 10 ค่าความสูงเท่ากับ 20 ให้แสดงชนิดตัวแปรผลลัพธ์พื้นที่ แล้วเปลี่ยนผลลัพธ์พื้นที่เป็นชนิด int | ||
|
||
base = 10 | ||
height = 20 | ||
area = 0.5 * base * height | ||
|
||
print("พื้นที่ของสามเหลี่ยมคือ:", area) | ||
print("พื้นที่เป็นชนิด int คือ:", type(area)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 7. ให้เขียนโปรแกรมหาพื้นที่สี่เหลี่ยมผืนผ้า เมื่อกำหนดให้ค่าความกว้างเท่ากับ 100 ความยาวเท่ากับ 400 ให้แสดงชนิดตัวแปรผลลัพธ์พื้นที่ เปลี่ยนผลลัพธ์พื้นที่เป็น str | ||
|
||
width = 100 | ||
length = 400 | ||
area = width * length | ||
|
||
print("พื้นที่ของสี่เหลี่ยมผืนผ้าคือ:", area) | ||
print("พื้นที่เป็นชนิด area คือ:", type(area)) |