#part I employees = {} phrase = ldap + '\'s name is \'' + name + '\' and he/she is a(n) ' + title def add_info(): if len(employees) > 5: print 'employees dict is full.' print 'here are the employee records' print phrase else: ans = raw_input('info: add or quit?') if ans == 'add': print employees print ldap + ' has been added sucessfully' else: print 'here are the employee records!' print phrase #partII data = [] total_int = raw_input('enter total integer: ') for i in range(int(total_int)): j = raw_input('enter an integer: ') data.append(int(j)) def sortlist(): for i in range(len(data)-1): max_int = data[i] if max_int > data[i+1]: data[i] = data[i+1] data[i+1] = max_int elif max_int <= data[i+1]: max_int = data[i+1] print data
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question