Skip to content

Instantly share code, notes, and snippets.

@srang992
Created November 20, 2022 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srang992/a13779b9399fa1f6ca2f6dd3444957d9 to your computer and use it in GitHub Desktop.
Save srang992/a13779b9399fa1f6ca2f6dd3444957d9 to your computer and use it in GitHub Desktop.
list1 = [1, 2, 3, 4 ,5]
list2 = ["one", "two", "three", "four", "five"]
new_dict = Dict(zip(list1, list2))
#=
it will return
Dict(5 => "five", 4 => "four", 2 => "two", 3 => "three", 1 => "one")
=#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment