1
16:25 จ. 29 ม.ค.
For ASS1.5.pdf
คำชี้แจง
1.9
1.8
1.6
1.7
ตัวแปรและการแสดงผลข้อมูล
ให้นักเรียนเขียนคำสั่งในการแสดงผลจากข้อมูลที่กำหนดให้ดังนี้
คําสั่ง python
ข้อที
1.1
1.2
1.3
1.4
1.5
print (Hello Python')
print(25+5)
x = 25 + 5
print(x)
num = '3'+'4'
print (num)
hello = "hi"
print(hello * 3)
dog = 'box'
a,b,c = 1.5, 5, 'Superman'
print (type(a))
print (type(b))
print (type(c))
a = "1.265"
print (type(a))
a = int(1.265)
print (type(a))
a = 3
b = 3.5
C = 'PCC'
print(' {} {} {}'.format(a, b, c))
print(' {2} {1} {0} ' .format(a, b, c))
1.10 x =2.151617298
print('{0}' .format(x))
print('{:.2f} .format(x))
ASS1.5.pdf - Google Drive
print("Name:",
Page
1
ผลลัพธ์
ของนักเรียน
เขียนโปรแกรมเพื่อแสดงชื่อ - นามสกุล
⠀
ให้นักเรียนใช้คำสั่ง print เพื่อแสดงค่า
dog
ผลลัพธ์ boxboxboxboxbox
"Class","
"No","
9% 1
x
.")
: