python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
keys=[] values=[] n=int(input("Enter number of elements for dictionary:")) print("For keys:") for x in range(0,n): element=int(input("Enter element" + str(x+1)+":")) keys.append(element) print("For values:") for x in range(0,n): element=int(input("Enter element" + str(x+1)+":")) values.append(element) d=dict(zip(keys,values)) print("The dictionary is:") print(d)
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up