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


Groups > comp.lang.python > #109897

Re: passing dictionay as argument

Path csiph.com!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!news.informatik.hu-berlin.de!fu-berlin.de!uni-berlin.de!not-for-mail
From "Frank Millman" <frank@chagford.com>
Newsgroups comp.lang.python
Subject Re: passing dictionay as argument
Date Mon, 13 Jun 2016 13:39:35 +0200
Lines 42
Message-ID <mailman.35.1465818002.2288.python-list@python.org> (permalink)
References <0b6372ce-3f16-431b-9e72-42d5c935df14@googlegroups.com> <njm61q$tpm$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de 1XOz57BCpl1uCWO3IpsFAQIjIZ4BCUezLAmBi4Jc1rIw==
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'error:': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'syntax': 0.13; 'argument': 0.15; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'skip:n 60': 0.22; 'pass': 0.22; 'wrote': 0.23; 'header:In-Reply- To:1': 0.24; 'header:X-Complaints-To:1': 0.26; 'define': 0.27; 'function': 0.28; "skip:' 10": 0.28; 'dictionary': 0.29; 'follows': 0.29; 'code:': 0.29; "skip:' 20": 0.34; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'skip:4 10': 0.38; 'to:addr:python.org': 0.40; 'frank': 0.72
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host 197.89.197.159
In-Reply-To <0b6372ce-3f16-431b-9e72-42d5c935df14@googlegroups.com>
X-MSMail-Priority Normal
Importance Normal
X-Newsreader Microsoft Windows Live Mail 15.4.3502.922
X-MimeOLE Produced By Microsoft MimeOLE V15.4.3502.922
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <njm61q$tpm$1@ger.gmane.org>
X-Mailman-Original-References <0b6372ce-3f16-431b-9e72-42d5c935df14@googlegroups.com>
Xref csiph.com comp.lang.python:109897

Show key headers only | View raw


"Arshpreet Singh"  wrote in message 
news:0b6372ce-3f16-431b-9e72-42d5c935df14@googlegroups.com...

> I have to pass dictionary as function argument for following code:

[...]

> result = authorize.Transaction.sale({
>     'amount': 40.00,
>
>     'credit_card': {
>         'card_number': '4111111111111111',
>         'expiration_date': '04/2014',
>         'card_code': '343',
>     }
>

[...]

> I want to define 'credit-card' dictionary as argument in the function as 
> follows but it returns syntax error:
>
> # define dictionary outside the function call:
> credit_card={
>         'card_number': '4111111111111111',
>         'expiration_date': '04/2014',
>         'card_code': '343',
>     }
>

[...]

> result = authorize.Transaction.sale({'amount': 40.00,credit_card})

Try this -

    result = authorize.Transaction.sale({'amount': 40.00, 
'credit_card':credit_card})

Frank Millman

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

passing dictionay as argument Arshpreet Singh <arsh840@gmail.com> - 2016-06-13 03:54 -0700
  Re: passing dictionay as argument David Navarro <davisein@gmail.com> - 2016-06-13 13:22 +0200
  Re: passing dictionay as argument marco.nawijn@colosso.nl - 2016-06-13 04:36 -0700
  Re: passing dictionay as argument "Frank Millman" <frank@chagford.com> - 2016-06-13 13:39 +0200

csiph-web