[Solved] How to add new item to dictionary in loop using uniquely generated string based on index? (Python)

Your immediate problem is this: LDates[‘%s’ % (‘string%s'[‘Id’] % i)] I believe that you mean to access the variable you created earlier. That would require you to use: LDates[(globals()[‘string%s’ % i])[‘Id’]] But this whole thing is ill-advised. Why don’t you create a variable where you can access all the data by just passing in the … Read more

[Solved] I keep getting a TypeError [closed]

If you convert the number in int then you should store in some variable. number = int(number) then do Oddoreven= number%2 And use = assignment sign not comparison == sign Because if u don’t store it in another variable it will not be casted to int and then it will be treated as string only … Read more

[Solved] TypeError: cannot concatenate ‘str’ and ‘list’ objects. how to convert list to string [closed]

str(tuple(str(fv[“v”]).split(‘,’))) will probably give you what you want but if you give more information there is definitely a better way to write this. What does fv[‘v’] consist of? 2 solved TypeError: cannot concatenate ‘str’ and ‘list’ objects. how to convert list to string [closed]

[Solved] Why is my int a pointer? [closed]

The while condition should probably read as: while (abs(nextValue – currValue) > 0.00000000001 && iter < 100000) Note that There is no semicolon at the end. The entire condition must be in parentheses. and is replaced by && – this is not strictly necessary because and is valid in C++ as far as I know, … Read more

[Solved] Python: Unhashable error, lists

Two major issues: 1) You are storing the results in chos_items, then not doing anything with them. full_items, when you exit the while loop, contains “end” or “” print(“That would be, {}”.format(‘ ‘.join([items[int(item)] for item in chos_items]))) Will give you a list of all the items chosen, but it won’t give how many, as you … Read more

[Solved] “Uncaught SyntaxError: Unexpected token , ” when create my object javascript

All objects must have keys. You define an object using curly bracers {}. Basically what you are saying is, add an array with one object that has no keys defined. If you want an array with the values a,b,c,d you can remove the bracers: myObjectList[0] = [“a”, “b”, “c”, “d”]; You always define objects with … Read more

[Solved] Decimal Subtraction [closed]

So your code bugged me alot. I made some changes to make things more pythonic… Instead of separate lists for your menu, I made it a list of tuples containing the product and it’s price I fixed your float casts There’s alot to be done for example, catching errors on invalid inputs, checking for available … Read more