Using Look Up Tables in Python

Since we are not given any further information about what ranges should be associated with which values, I assume you will transfer my answer to your own problem. Look-up-Tables are called dictionary in python. They are indicated by curly brackets. Easy example: Here you create a dictionary with three entries: 1, 2, 3. Each of … Read more

examining items in a python Queue

The Queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. As you can see, the Queue module was created specifically for use with threads, providing only FIFO, LIFO and priority queues, none of which provide this functionality. However by examining the source … Read more

Replacing a character from a certain index

How can I replace a character in a string from a certain index? For example, I want to get the middle character from a string, like abc, and if the character is not equal to the character the user specifies, then I want to replace it. Something like this maybe?