[Tutor] (no subject)

Alan Gauld alan.gauld at yahoo.co.uk
Tue Feb 16 11:39:20 EST 2021


On 16/02/2021 10:43, ੧ wrote:
>  I have started learning Python recently.
> Please help me with this.
> 
> Create a dictionary where all the keys are strings, and all the values are
> integers.
> For example: {'Monday':19,'Tuesday':20}
> Write the dictionary on a single line, don't assign a variable name to the
> dictionary.

What exactly do you need help with?
You seem to have successfully solved the problem in your request.

Having said that, writing it on a single line without assignment
is only useful (and even then, not very) within the interactive
interpreter. It's considered a bug in any real program.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list