Aug-21-2019, 05:40 AM
I´m assuming you want to create a list instead of a dictionary, cause you named your dictionary patientlist which is a contradiction.
But let´s assume you want to use a dictionary you need to do it this way.
So let´s assume you want to create a list of your patient names, do it this way.
But let´s assume you want to use a dictionary you need to do it this way.
patients = {} for x in range(3): patient_name = input('Enter new name: ') patients[patient_name] = patient_name for key, value in patients.items(): print(key, value)But using the same content for key and the value is nonsense imho.
So let´s assume you want to create a list of your patient names, do it this way.
patients = [] for x in range(3): patient_name = input('Enter new name: ') patients.append(patient_name) for name in patients: print(name)