Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #80414 > unrolled thread
| Started by | Yusuf Can Bayrak <yusufcanbayrak@gmail.com> |
|---|---|
| First post | 2014-11-08 00:04 +0200 |
| Last post | 2014-11-08 00:04 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
dictionary issue for formatted print Yusuf Can Bayrak <yusufcanbayrak@gmail.com> - 2014-11-08 00:04 +0200
| From | Yusuf Can Bayrak <yusufcanbayrak@gmail.com> |
|---|---|
| Date | 2014-11-08 00:04 +0200 |
| Subject | dictionary 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]
>
>
Back to top | Article view | comp.lang.python
csiph-web