Report this

What is the reason for this report?

dict() function isn't working properly on the cloud server (Python3)

Posted on September 20, 2017
Ali

By Ali

Hi, i’m having problem using python3 on my Ubuntu 16.04.3 x64 with the dict() function when i use it on my own PC it works fine but on the cloud server isn’t running well…

after sorting my dictionary with sotred() function i get this output (example):

[(1, {'car': 'red'}, 2, {'bike': 'green'}, 3, {'plane': 'white'})]

when i want it to turn the tuple to dictionary i use dict() (example):

dict([(1, {'car': 'red'}, 2, {'bike': 'green'}, 3, {'plane': 'white'})])

but when use the dict function it reorder everything randomly (example):

{2, {'bike': 'green'}, 3, {'plane': 'white'}, 1, {'car': 'red'}}

any idea why?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.