The following code:
a={"hello":[23,],90:["Hi",],25:[54,]}
for i in a:
hrs=print(a[i],": ")
Has this output:
[23]:
["Hi"]:
[25]:
Whereas I need the output to be printed without the brackets like:
23:
"Hi":
25:
>Solution :
Try this:
a={"hello":[23,],90:["Hi",],25:[54,]}
for i in a:
print(repr(a[i][0]), ':', sep='')
Output:
23:
'Hi':
54: