Advertisement
big_cee223

ตัวอย่างข้อสอบ Computer Programming ข้อที่ 1

Dec 26th, 2020 (edited)
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. #ตัวอย่างข้อสอบ Computer Programming ข้อที่ 1
  2. #Part 1
  3. num_int=int(input("Please insert number (1-9): "))
  4. while num_int==0 or num_int>9:
  5.     print("Invalid value! Please try again!")
  6.     num_int=int(input("Please insert number (1-9): "))
  7. real_num=float(input("Please insert number with decimal: "))
  8. word=input("Insert any string want: ")
  9. #Part 2
  10. num_order="1234567890"
  11. print(num_order*5)
  12. print('%-13s%22s%15s'%('INTEGER','FLOATING-POINT NUMBER','STRING'))
  13. print('%4d%31.5f%15s'%(num_int,real_num,word))
  14.  
  15. '''
  16. #Notes
  17. print(len("FLOATING-POINT NUMBER"))----21
  18. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement