python correct dictionary notation [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would need something like
{"a"=1,"b"=2,"c"=3,"d"=4}
but python is not able to decode it, it gives me an error message. is there a way around that?
thank you

Replacing the "=" with ":" should work...

Related

How do I make this python code work? (regexp package used) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 days ago.
Improve this question
Guys can you help me make this work?
enter image description here
I tried putting - str(ware_1)

VSCODE - Clean output without path [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
How do I config my vscode output to look like the first image?
What I want:
What it actually looks like:

How to find the size of an image in bytes using python? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I couldn't find anyway to print the size of an image in bytes.
You can simply use os.
import os
os.path.getsize('test.jpg')

I have pygame installed but VSC marks it red [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I'm a new programmer and have no idea why this is happening.
You have some amount of spaces before the import pygame text on the first line.

How to concatenate a Python dictionary [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
My questions refers to a "concatenation" of a Python dictionary. For example: I have a dictionary di = {1:'AB', 2:'BC',3:'CD'}, and I want with one command print(____) to get the output 'ABCD'.
Any suggestions?
Try This One.
print(''.join(str(e) for e in list(sorted(set(di[1]+di[2]+di[3]))))
Hope that this is what you wanted
di = {1:'AB', 2:'BC',3:'CD'}
print((di[1]+di[2]+di[3]).replace((di[2]),''))

Categories

Resources