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" Newsgroups: comp.lang.python Subject: Re: passing dictionay as argument Date: Mon, 13 Jun 2016 13:39:35 +0200 Lines: 42 Message-ID: References: <0b6372ce-3f16-431b-9e72-42d5c935df14@googlegroups.com> 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: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <0b6372ce-3f16-431b-9e72-42d5c935df14@googlegroups.com> Xref: csiph.com comp.lang.python:109897 "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