ACS Workshop (python)
    
            มาทำโจทย์กันเถอะะะะะ (โดยพรี่ภูมิ)
Question 1
- เขียนโปรแกรมหาความสูงของจุดสูงสุดของลูกบอลกับพื้นโดยโยนลูกบอลขึ้นไปในแนวดิ่งอยู่ในอากาศ t วินาที ก่อนจะตกถึงพื้น
 
| รูปเเบบ Output | 
| ระดับความสูงระหว่างลูกบอลกับพื้น ตอบเป็นทศนิยม 2 ตําแหน่ง | 
| ข้อจำกัด | 
| ค่า g = 9.8 m/s2 | 
quest1_input = # Question1 input
def find_max_height(t):
    g = # your code here  
    H = # your code here 
    return H
print(find_max_height(quest1_input))
hint สูตรคือ h=ut+1/2gt^2 โดย u คือ ความเร็วต้น s คือระยะทาง 
Question 2
- เขียนโปรแกรมหาเส้นรอบรูปสี่เหลี่ยมผืนผ้า โดยกำหนดให้ ความกว้าง-ความยาว ของรูปสี่เหลี่ยมมา
 
| รูปเเบบ Output | 
| เส้นรอบรูปสี่เหลี่ยมผืนผ้า ตอบเป็นทศนิยม 2 ตําแหน่ง | 
def find_perimeter(width,length)
    perimeter = # your code here 
    return # your code here 
width= # Question2 input (line1)
length= # Question2 input (line2)
print(find_perimeter(width, length))
Question 3
- หาตัวเลขในรายการ (list) ที่น้อยที่สุด ให้มีรายการ (list) ที่มีตัวเลขเก็บอยู่
 
| รูปเเบบ Output | 
| เลขที่น้อยที่สุด | 
| ข้อจำกัด | 
| ห้ามใช้ built in functions เช่น min() ,ตัวเลขเป็น integer | 
def find_minimum(numbers):
    min_num = numbers[0]
    for #your code here
        if #your code here
            #your code here
    return min_num
my_list = # Question3 input
minimum_number = find_minimum(my_list)
print(minimum_number) 
Question 4
- เขียนฟังก์ชันที่ย้อนกลับสตริง โดยสตริงอินพุตจะได้รับเป็นสตริงของอักขระ
 
| รูปเเบบ Output | 
| string ที่ย้อนกลับแล้ว | 
| ข้อจำกัด | 
| ห้ามใช้ built in functions | 
def reverseString(s):
    for i in ## your code here
        new_String = # your code here
my_String = 'etuc os uoy'
my_String = reverseString(my_String)  
print(my_String)  
Question 5
- เขียนฟังก์ชันที่ตรวจสอบ x ว่าเป็นพาลินโดรมรึป่าว โดยกําหนด x เป็น int
 
| รูปเเบบ Output | 
| ส่งกลับค่า true ถ้าเป็นจริงและ false ถ้าเป็นเท็จ | 
| ข้อจำกัด | 
| ห้ามใช้ built in functions | 
def isPalindrome(x):
    x_str = str(x)
   	return #your code here
  print(isPalindrome(12321))
Question 6
- ใช้สัญลักษณ์ "#" เพื่อสร้างรูปเพรช
 
| ข้อจำกัด | 
| ห้ามใช้ built in functions | 
def draw_diamond(x):
		#your code here
print(draw_diamond(9))