Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. def to_dict(keyy, valuee): #Turns input into dict and then puts to list
  2. total = tuple()
  3. my_dict = {}
  4. my_dict[value] = valuee
  5. my_dict[key] = keyy
  6. for each in my_dict:
  7. total.append(each)
  8. return total
  9.  
  10.  
  11. def main():
  12. more = ""
  13. while True:
  14. if more == "y":
  15. valuee = input("Name: ")
  16. keyy = input("Number: ")
  17. more = input("More data (y/n)? y ")
  18. if more == "n":
  19. break
  20. total = to_dict(keyy, valuee)
  21. print(total)
  22.  
  23. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement