Differences between revisions 2 and 6 (spanning 4 versions)
Revision 2 as of 2018-10-14 23:38:33
Size: 842
Comment:
Revision 6 as of 2019-10-16 14:42:15
Size: 868
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
#acl AdminGroup:read,write,delete,revert,admin TadashiIijima:read,write,delete,revert,admin IijimaStaffGroup: IijimaGroup: IijimaObogGroup: GuestGroup: Known: All: #acl AdminGroup:read,write,delete,revert,admin TadashiIijima:read,write,delete,revert,admin IijimaStaffGroup: IijimaGroup: IijimaObogGroup: GuestGroup: Known: All:read
Line 7: Line 7:
[ <<Action(edit)>> ]

[ edit ]

  • 解答は基本的に,下記 7 行です.

   1 def judge_high_and_low( x, correct_number ):
   2     if x == correct_number:
   3         return( "正解です" )
   4     elif x > correct_number:
   5         return( "大きすぎます" )
   6     else:
   7         return( "小さすぎます" )
  • でも,単純に,正解なら整数の0, 大きすぎるとき正の数,小さすぎるとき負の数を返すと考えれば,単純に引き算で表現できます.

   1 def judge_high_and_low( x, correct_number ):
   2     return( int( x - correct_number ))

SoftEng: Python/Prog/Practice/Extended/02/EP_005a/Digest (last edited 2019-10-16 14:42:15 by TadashiIijima)