From 2f2e677ce1c2a0b908230c847700f3cab17810d6 Mon Sep 17 00:00:00 2001 From: Jonas_Jones <91549607+J-onasJones@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:54:48 +0200 Subject: [PATCH] added another one --- keyvaluepairgenerator.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 keyvaluepairgenerator.py diff --git a/keyvaluepairgenerator.py b/keyvaluepairgenerator.py new file mode 100644 index 0000000..c133474 --- /dev/null +++ b/keyvaluepairgenerator.py @@ -0,0 +1,14 @@ +# Open the file in write mode ('w') +with open('uwu.txt', 'w') as file: + while True: + input1 = input('Enter input-1 (or leave it empty to exit): ') + input2 = input('Enter input-2 (or leave it empty to exit): ') + + # Check if both inputs are empty, and exit the loop if they are + if not input1 and not input2: + break + + # Write the input pair to the file in the specified format + file.write(f"'{input1}': '{input2}',\n") + +print('Data saved to uwu.txt.')