Guest User

Untitled

a guest
Dec 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. def dictionary_and_list(*args, li=[], dic={},**keywords):
  2. if len(args) > 0:
  3. for arg in args:
  4. li.append(arg)
  5. if len(keywords) > 0:
  6. for keywd in keywords:
  7. dic[keywd] = keywords[keywd]
  8. return {'a_list': li, 'a_dictionary': dic}
  9.  
  10. dictionary_and_list('Ok, ', 'you ', 'are done, ')
  11. dictionary_and_list('it is time ', heading=3, back=2)
  12. dictionary_and_list('to leave this ', 'Python world. ',
  13. 'Congratulations on all your accomplishments! ', to=1)
  14. dictionary_and_list('Goodbye!', earth=0)
  15.  
  16. def back_to_earth(*args, heading='Is', back='it', to='yet', earth='time?'):
  17. last_words = 'Ok, your there: ' + str(liftoff.__next__()-2) + '%! '
  18. for arg in args:
  19. last_words += arg
  20. last_words += '\nHeading\n' + str(heading) + '\nback\n' + str(back) + '\nto\n' + str(to) + '\nearth!\n' + str(earth)
  21. print(last_words)
  22.  
  23. back_to_earth(*dictionary_and_list()['a_list'], **dictionary_and_list()['a_dictionary'])
Add Comment
Please, Sign In to add comment