Re: Help with python code

2016-03-29 Thread Wildman via Python-list
On Tue, 29 Mar 2016 21:19:05 +, Rob Gaddi wrote: >> menu = input("Enter the type of pizza that you want to order from 1-5 \n") >> while menu>5 or menu <=0: >> menu = input ("Enter the right number ") >> pizza_cost = pizzatype[menu] As it has already been pointed out, a Python list starts

Re: Help with python code

2016-03-29 Thread Rob Gaddi
Yum Di wrote: > I still don't get it.. Sorry, I'm still quite new to this > I've have made few minor changes, but it still doesn't work Then try entering one line at a time of your program into the interactive interpreter. Copy and paste is fine, but use the interpreter to look at the actual val

Re: Help with python code

2016-03-29 Thread Yum Di
import random import time pizzatype = [3.50,4.20,5.20,5.80,5.60] drinktype = [0.90,0.80,0.90] topping = [0.50,0.50,0.50,0.50] def Total_cost_cal (pt ,dt ,t): total = pt + dt + t return total print ("Welcome to Pizza Shed!") order = raw_input ("\n\nPLEASE PRESS ENTER TO ORDER." ) tablen

Re: Help with python code

2016-03-29 Thread Rob Gaddi
okdk wrote: > This is my code > import random > import time > > pizzatype = [3.50,4.20,5.20,5.80,5.60] > drinktype = [0.90,0.80,0.90] > topping = [0.50,0.50,0.50,0.50] > > def Total_cost_cal (pt ,dt ,t): > total = pt + dt + t > return total > > print ("Welcome to Pizza Shed!") > > order =

Re: Help with python code

2016-03-29 Thread BartC
On 29/03/2016 22:00, okdk wrote: pizzatype = [3.50,4.20,5.20,5.80,5.60] drinktype = [0.90,0.80,0.90] topping = [0.50,0.50,0.50,0.50] total_cost = total_cost_cal(pizzatotal, drinktotal, topping_cost) print ("") print ("Calculating bill") print ("---

Re: Help with python code!

2013-04-02 Thread Jason Friedman
> Thanks for your replies. Just to be clear this is for a interview and they > would like me to figure out what the code does and come back with some test > cases. I don't need to code the tests, just give some high level tests. As > far as I can make out it is some system where you input your name

Re: Help with python code!

2013-04-01 Thread Alister
On Sun, 31 Mar 2013 14:32:21 -0700, gerrymcgovern wrote: > On Sunday, March 31, 2013 5:27:06 PM UTC-4, Roy Smith wrote: >> In article <4455829d-5b4a-44ee-b65f-5f72d429b...@googlegroups.com>, >> >> jojo wrote: >> >> >> >> > Thanks for your replies. Just to be clear this is for a interview and

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 9:02 AM, Mark Lawrence wrote: > On 31/03/2013 22:21, Chris Angelico wrote: >>> >>>sue = time.mktime( >>> (int(m.group(7)), int(months[m.group(2)]), int(m.group(3)), >>>int(m.group(4)), int(m.group(5)), int(m.group(6)), >>>int(days[m.g

Re: Help with python code!

2013-03-31 Thread Mark Lawrence
On 31/03/2013 22:21, Chris Angelico wrote: sue = time.mktime( (int(m.group(7)), int(months[m.group(2)]), int(m.group(3)), int(m.group(4)), int(m.group(5)), int(m.group(6)), int(days[m.group(1)]), 0, 0) ) expire_time = (sue ­ current_time)/60

Re: Help with python code!

2013-03-31 Thread rurpy
On Sunday, March 31, 2013 3:27:06 PM UTC-6, Roy Smith wrote: > If this is for an interview, you really should be doing this on your > own. I assume the point of the interview is to see how well you know > Python. Please don't expect people here to take your interview for you. Maybe the interv

Re: Help with python code!

2013-03-31 Thread gerrymcgovern
On Sunday, March 31, 2013 5:35:38 PM UTC-4, Chris Angelico wrote: > On Mon, Apr 1, 2013 at 8:21 AM, jojo wrote: > > > Thanks for your replies. Just to be clear this is for a interview and they > > would like me to figure out what the code does and come back with some test > > cases > > > > T

Re: Help with python code!

2013-03-31 Thread gerrymcgovern
On Sunday, March 31, 2013 5:27:06 PM UTC-4, Roy Smith wrote: > In article <4455829d-5b4a-44ee-b65f-5f72d429b...@googlegroups.com>, > > jojo wrote: > > > > > Thanks for your replies. Just to be clear this is for a interview and they > > > would like me to figure out what the code does and co

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 8:21 AM, jojo wrote: > Thanks for your replies. Just to be clear this is for a interview and they > would like me to figure out what the code does and come back with some test > cases That explains the utter lack of comments, then. In well-maintained code, you would simpl

Re: Help with python code!

2013-03-31 Thread Roy Smith
In article <4455829d-5b4a-44ee-b65f-5f72d429b...@googlegroups.com>, jojo wrote: > Thanks for your replies. Just to be clear this is for a interview and they > would like me to figure out what the code does and come back with some test > cases. I don't need to code the tests, just give some hig

Re: Help with python code!

2013-03-31 Thread jojo
On Sunday, March 31, 2013 5:13:49 PM UTC-4, Roy Smith wrote: > In article <2912c674-e30b-4339-9344-1f460cb96...@googlegroups.com>, > > jojo wrote: > > > > > for fname in dirList: > > > cmd = "keytool �printcert �file " + fname > > > for line in os.popen(cmd).readlines(): > > >line =

Re: Help with python code!

2013-03-31 Thread gerrymcgovern
On Sunday, March 31, 2013 5:21:00 PM UTC-4, Chris Angelico wrote: > On Mon, Apr 1, 2013 at 8:06 AM, jojo wrote: > > > On Sunday, March 31, 2013 4:39:11 PM UTC-4, Chris Angelico wrote: > > >> On Mon, Apr 1, 2013 at 7:10 AM, jojo wrote: > > >> > > >> > Im used to C# so the syntax looks bizarre t

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 8:06 AM, jojo wrote: > On Sunday, March 31, 2013 4:39:11 PM UTC-4, Chris Angelico wrote: >> On Mon, Apr 1, 2013 at 7:10 AM, jojo wrote: >> >> > Im used to C# so the syntax looks bizarre to me! Any help would be great. >> >> >> >> The first thing you'll need to understand abo

Re: Help with python code!

2013-03-31 Thread Roy Smith
In article <2912c674-e30b-4339-9344-1f460cb96...@googlegroups.com>, jojo wrote: > for fname in dirList: > cmd = "keytool ­printcert ­file " + fname > for line in os.popen(cmd).readlines(): >line = line.rstrip() >m = p.search(line) >if m: > sue = time.mktime( > (int(m.

Re: Help with python code!

2013-03-31 Thread Roy Smith
In article <37f23623-8bf5-421a-ab6a-34ff622c6...@googlegroups.com>, jojo wrote: > Hi - I am a newbie to python and was wondering can someone tell me what the > following code does. I need to figure out how to test it I know this is going to sound unhelpful, but if your task is to test the cod

Re: Help with python code!

2013-03-31 Thread jojo
On Sunday, March 31, 2013 4:39:11 PM UTC-4, Chris Angelico wrote: > On Mon, Apr 1, 2013 at 7:10 AM, jojo wrote: > > > Im used to C# so the syntax looks bizarre to me! Any help would be great. > > > > The first thing you'll need to understand about Python syntax is that > > indentation is impor

Re: Help with python code!

2013-03-31 Thread Chris Angelico
On Mon, Apr 1, 2013 at 7:10 AM, jojo wrote: > Im used to C# so the syntax looks bizarre to me! Any help would be great. The first thing you'll need to understand about Python syntax is that indentation is important. By posting this code flush-left, you've actually destroyed its block structure. C