Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80414 > unrolled thread

dictionary issue for formatted print

Started byYusuf Can Bayrak <yusufcanbayrak@gmail.com>
First post2014-11-08 00:04 +0200
Last post2014-11-08 00:04 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  dictionary issue for formatted print Yusuf Can Bayrak <yusufcanbayrak@gmail.com> - 2014-11-08 00:04 +0200

#80414 — dictionary issue for formatted print

FromYusuf Can Bayrak <yusufcanbayrak@gmail.com>
Date2014-11-08 00:04 +0200
Subjectdictionary issue for formatted print
Message-ID<mailman.15592.1415528662.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

when dictionary has one value for each key it's okey. I'm just type '%
greek_letters' and it's working.

But how can i assign dict's values to formatted print, if it has more
values than one.

>
>    1. # -*- coding: utf-8 -*-
>    2. greek_letters = {
>    3.                     'omega': ['ω','Ω'], 'psi': ['ψ', 'Ψ'] , 'kapa':
>    'κ', 'to': ['τ', 'Τ'], 'lambda': ['λ', 'Λ'],
>    4.                     'ksi': ['ξ', 'Ξ'], 'delta': ['δ', 'Δ'], 'mu':
>    ['μ'], 'sigma': ['σ', 'Σ'], 'epsilon': ['ε', 'Ε'],
>    5.                     'gamma': ['γ', 'Γ'], 'phi': ['φ', 'Φ'],
>    'theta': ['θ', 'Θ']
>    6.                 }
>    7. print 'x(%(to)s) = A * cos(%(omega)s * %(to)s + %(theta)s)' %
>    greek_letters.values()[1]
>
>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web