I'm trying to create a little program that stores user-entered information in a nested dictionary and then converts it to a Pandas dataframe.
The dictionary should look something like this:
The dictionary should look something like this:
Credentials = { 'username' : {'password' : 'qwerty123' 'email' : '[email protected]'} }I don't know how to store the credentials in the appropriate dictionary assigned to the username entered. I tried several solutions but they didn't work. Here is the code:
import pandas as pd while True: print('Welcome to profiles creator!') CreateDict = str(input('Do you want to create a new profile? (y/n): ')) if CreateDict == 'y' or CreateDict == 'yes': Dict = dict() elif CreateDict == 'n' or CreateDict == 'no': break; else: print('Insert valid character!') Username = str(input('Username: ')) Passwd = str(input('New password: ')) BirthDate = str(input('Date of birth (MM/GG/YY): ')) Notes = str(input('Addition optional info: '))