This is a very interesting task. Good work on doing it. Here are some criticism.
print('If your integer is a negative, the script will ask.') print("DO NOT GIVE -X integers for input!!!") print('Script will output multiple - symbols for a negative integer transformation')
- Do not use both double quote
(
"") and single quote ('') strings. Pick one. I personally prefer"".
while 0 == 0: ask = input('Enter an integer from a subset-sum instance sequentially.')
- It's considered a best practice to indent using 4 spaces instead of 2.
- Also it would be better to move actual transform functionality to a new function.
- Also it's better to use
while Trueinstead ofwhile 0 == 0to indicate a endless loop. - Reason: This is more readable.
askStr = str(ask) res = list(map(int, str(askStr))
- You are converting
asktwice to a string. This is redundant. - Since
input()returns a string you don't need to convert this at all. - It is also a better to use python conventions for names. Ex:
ask_strorvalue
x = (res)
- You don't need parenthesis here.
- There is also no need to assign to
xyou can directly useres.
if asktwo == str("y"): twinkle = str('-') else: twinkle = str(" ")
- You don't need to convert a string literal to a string again.
- You can directly use
"y"as a string. twinkleis not a good name. Use something likesign.