Home > other >  Redeclared 'a' defined above without the usage
Redeclared 'a' defined above without the usage

Time:11-26

# - * - coding: utf-8 - * -
The import time


Def hs1 (hsa) :
Print '% s classmate, your result is: % s points' % (hsa, dic (hsa))
Print 'query time: % s' % time. The strftime (' % % Y - m - H: % d % % m: % s', and time. The localtime ())


Small dic={' A ': 100,' the little b: 60}
Hsa1=raw_input (" please input your name:)
For a in range (5) :
If hsa1 in dic:
Hs1 (hsa1)
Break
The else:
Print 'I'm sorry, didn't check the name for "% s" students' % hsa1
Hsa1=raw_input (' please re-enter your name (you can also check out % d times) : '% (5 - a))
A=a + 1
Else: print 'I'm sorry, but did not check the students name for "% s", the query has finished, if you want to query, please login again! '% hsa1

CodePudding user response:

What is the purpose of a=a + 1?

CodePudding user response:

, have been used for, do not need to use a=a + 1 to cycle index,
And the last sentence the else: print also has no meaning, if the two can bolck direct return
  • Related