1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | #1. def q1(): a = input ( "姓名" ) b = input ( "學號" ) c = input ( "班級" ) print (a,b,c) #2. def q2(): i = 1 while (i< 301 ): print (i) i + = 1 for i in range ( 1 , 301 ): print (i) #3. def q3(): sum = 0 for i in range ( 1 , 301 ): sum = sum + i print ( sum ) #4. # -*- coding: utf-8 -*- def q4(): name = input ( "Please enter a character string: " ) print ( "The string capitalized is " , end = "") for i in range ( 0 , 6 ): dec = int ( ord (name[i])) newstr = chr (dec - 32 ) print (newstr,end = "") print () #5. def q5(R): print (R * R * 3.14159265 ) |
2011年10月29日 星期六
100設計一甲_week6_模擬考答案
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言