Re: [Tutor] How to calculate the total cost

2016-03-30 Thread Alan Gauld
Forwarding to the list, please always use Reply All or reply List when
responding to tutor messages.

On 30/03/16 21:03, Nevina Dias wrote:
> Hey,
> I'm not sure.. 
> This is how our teacher said to do. He said to use input..

input() is the correct thing to use in v3 but you are using it wrongly.
But first please confirm whether you are using Python v2 or v3?
input() works very differently depending on which version you use.

What happens when you try to run your program as it is?
Do you get an error message?


One of the most important techniques to learn in Python is to write
small amounts of code and then test them. Only when the first
small part is working should you write more code.
Then if it breaks you know which bit of code(the new bit)
must be faulty.

So before worrying about totals get the existing code to run
without errors.

 
>
> 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
>
> but it didn't work.
>

That code doesn't do anything. You just define some values
but never use them. But saying "it didn't work" is not helpful.
It doesn't tell us how it didn't work. Did you get an error
message? If so what? If not did you get any output? - what?
Was it what you expected? If not what did you expect?

If you provide more detailed information you will get more
useful feedback.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] (no subject)

2016-03-30 Thread Alan Gauld
On 30/03/16 13:18, Jay Li wrote:
> 
> http://idealwm.com/miles.php 
> 
> Best regards,
> Jay Li

Apologies, a couple of these messages have snuck through
this week. It's been entirely my fault, I've hit the approve
button when I meant to hit reject. The server is working
fine, it's human error. Too many late nights fighting
with Java... :-(


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to calculate the total cost

2016-03-30 Thread Alan Gauld
On 30/03/16 13:43, Nevina Dias via Tutor wrote:
> import random 
> import time 
> 
> print ("Welcome to Pizza Shed!") 
> 
> tablenum = input ("Enter table number from 1-25 \n ") 
> while tablenum>25 or tablenum <=0: 
> tablenum = input ("Enter the correct table number, there are only 25 
> tables ") 

Assuming you are using python v3 you have more serious problems
to solve first. Try to get you existing code to run then we
can consider how to add all the different totals.
Hint: The sum() function might help.

In particular input() in v3 doesn't do what you seem to
think it does.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to calculate the total cost

2016-03-30 Thread Joel Goldstick
On Wed, Mar 30, 2016 at 8:43 AM, Nevina Dias via Tutor 
wrote:

> import random
> import time
>
> print ("Welcome to Pizza Shed!")
>
> tablenum = input ("Enter table number from 1-25 \n ")
> while tablenum>25 or tablenum <=0:
> tablenum = input ("Enter the correct table number, there are only 25
> tables ")
>
> #Pizza menu with prices
>
> print ("-")
>
> print ("Let me help you with your order!")
>
> print ("-")
>
> print ("Menu")
>
> print (
> "1 = cheese and tomato: 3.50, "
> "2 = ham and pineapple: 4.20, "
> "3 = vegetarian: 5.20, "
> "4 = meat feast: 5.80, "
> "5 = seafood: 5.60 " )
>
> pizza_choice = input("Enter the type of pizza that you want to order from
> 1-5 \n")
> while pizza_choice>5 or pizza_choice <=1:
> pizza_choice = input ("Enter the right number ")
>
> if pizza_choice == 1:
> print "You have chosen cheese and tomato. The cost for this is 3.50"
> elif pizza_choice == 2:
> print ("You have chosen ham and pineapple. The cost for this is 4.20")
> elif pizza_choice == 3:
> print ("You have chosen vegetarian. The cost for this is 5.20")
> elif pizza_choice == 4:
> print ("You have chosen meat feast. The cost for this is 5.80")
> elif pizza_choice == 5:
> print ("You have chosen sea food. The cost for this is 5.60")
>
> print ("--")
>
> pizza_amount = input ("Enter the amount of Pizzas that you want to order ")
> while pizza_amount > 10 or pizza_amount <=0:
> pizza_amount = input ("Maximum amount is 10, Please enter again ")
>
> print ("")
>
> #base
>
> print ("Base")
>
> print (
> "1 = thin and crispy,"
> "2 = traditional" )
>
> base = input ("Select a base from 1-2 \n")
> while base>2 or base<=1:
> base = input ("There are only 2 types, Please enter again ")
>
> if base == 1:
> print "You have chosen thin and crispy"
> elif base == 2:
> print ("You have chosen traditional")
>
> print ("---")
>
> #extra toppings
>
> print ("Extra Toppings")
>
> toppings = input ("Enter a number for your choice of extra topping \n
> Enter 1 for extra cheese \n Enter 2 for extra pepperoni \n Enter 3 for
> extra pineapple \n Enter 4 for extra peppers \n" )
> while toppings >4 or toppings < 0:
> toppings = input ("There are only 4 types of extra toppings, Please
> try again " )
>
> if toppings == 1:
> print ("You have chosen extra cheese. The cost for this is 0.50")
> elif toppings == 2:
> print ("You have chosen pepperoni. The cost for this is 0.50")
> elif toppings == 3:
> print ("You have chosen pineapple. The cost for this is 0.50")
> elif toppings == 4:
> print ("You have chosen peppers. The cost for this is 0.50")
>
> print ("-")
>
> #drink
>
> print ("Drink")
>
> print (
> "1 = Cola: 0.90, "
> "2 = Lemonande: 0.80, "
> "3 = Fizzy Orange: 0.90 " )
>
> drink = input ("Enter a number for your choice of drinks " )
> while drink>3 or drink<0:
> drink = input ("Choices start from 0 to 3 " )
>
> if drink == 1:
> print "You have chosen Cola. The cost for this is 0.90"
> elif drink == 2:
> print ("You have chosen Lemonande. The cost for this is 0.80")
> elif drink == 3:
> print ("You have chosen Fizzy Orange. The cost for this is 0.90")
>
> drink_amount = input ("Enter the amount of drinks")
> while drink_amount >10 or drink_amount<0:
> drink_amount = input (" You can only have upto 10 drinks, Please try
> again")
>
> print ("")
> print ("Calculating bill")
> print ("")
> print ("")
>
> print ("Thank You for ordering at Pizza Shed! ")
>
>
> Hey, this is my code..
> I need to calculate the total cost, but I m not sure how to do that.
>
> Can someone please help me.
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

There is a whole thread with this exact same content over the last few
days.  If that person is your classmate, maybe you should get together.  If
you are the same person, using a different email address, please don't

-- 
Joel Goldstick
http://joelgoldstick.com/ 
http://cc-baseballstats.info/
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] How to calculate the total cost

2016-03-30 Thread Nevina Dias via Tutor
import random 
import time 

print ("Welcome to Pizza Shed!") 

tablenum = input ("Enter table number from 1-25 \n ") 
while tablenum>25 or tablenum <=0: 
tablenum = input ("Enter the correct table number, there are only 25 tables 
") 

#Pizza menu with prices 

print ("-") 

print ("Let me help you with your order!") 

print ("-") 

print ("Menu") 

print ( 
"1 = cheese and tomato: 3.50, " 
"2 = ham and pineapple: 4.20, " 
"3 = vegetarian: 5.20, " 
"4 = meat feast: 5.80, " 
"5 = seafood: 5.60 " ) 

pizza_choice = input("Enter the type of pizza that you want to order from 1-5 
\n") 
while pizza_choice>5 or pizza_choice <=1: 
pizza_choice = input ("Enter the right number ") 

if pizza_choice == 1: 
print "You have chosen cheese and tomato. The cost for this is 3.50" 
elif pizza_choice == 2: 
print ("You have chosen ham and pineapple. The cost for this is 4.20") 
elif pizza_choice == 3: 
print ("You have chosen vegetarian. The cost for this is 5.20") 
elif pizza_choice == 4: 
print ("You have chosen meat feast. The cost for this is 5.80") 
elif pizza_choice == 5: 
print ("You have chosen sea food. The cost for this is 5.60") 

print ("--") 

pizza_amount = input ("Enter the amount of Pizzas that you want to order ") 
while pizza_amount > 10 or pizza_amount <=0: 
pizza_amount = input ("Maximum amount is 10, Please enter again ") 

print ("") 

#base 

print ("Base") 

print ( 
"1 = thin and crispy," 
"2 = traditional" ) 

base = input ("Select a base from 1-2 \n") 
while base>2 or base<=1: 
base = input ("There are only 2 types, Please enter again ") 

if base == 1: 
print "You have chosen thin and crispy" 
elif base == 2: 
print ("You have chosen traditional") 

print ("---") 

#extra toppings 

print ("Extra Toppings") 

toppings = input ("Enter a number for your choice of extra topping \n Enter 1 
for extra cheese \n Enter 2 for extra pepperoni \n Enter 3 for extra pineapple 
\n Enter 4 for extra peppers \n" ) 
while toppings >4 or toppings < 0: 
toppings = input ("There are only 4 types of extra toppings, Please try 
again " ) 

if toppings == 1: 
print ("You have chosen extra cheese. The cost for this is 0.50") 
elif toppings == 2: 
print ("You have chosen pepperoni. The cost for this is 0.50") 
elif toppings == 3: 
print ("You have chosen pineapple. The cost for this is 0.50") 
elif toppings == 4: 
print ("You have chosen peppers. The cost for this is 0.50") 

print ("-") 

#drink 

print ("Drink") 

print ( 
"1 = Cola: 0.90, " 
"2 = Lemonande: 0.80, " 
"3 = Fizzy Orange: 0.90 " ) 

drink = input ("Enter a number for your choice of drinks " ) 
while drink>3 or drink<0: 
drink = input ("Choices start from 0 to 3 " ) 

if drink == 1: 
print "You have chosen Cola. The cost for this is 0.90" 
elif drink == 2: 
print ("You have chosen Lemonande. The cost for this is 0.80") 
elif drink == 3: 
print ("You have chosen Fizzy Orange. The cost for this is 0.90") 

drink_amount = input ("Enter the amount of drinks") 
while drink_amount >10 or drink_amount<0: 
drink_amount = input (" You can only have upto 10 drinks, Please try 
again") 

print ("") 
print ("Calculating bill") 
print ("") 
print ("") 

print ("Thank You for ordering at Pizza Shed! ") 


Hey, this is my code.. 
I need to calculate the total cost, but I m not sure how to do that. 

Can someone please help me.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-30 Thread wolfrage8...@gmail.com
On Wed, Mar 30, 2016 at 10:36 AM, john  wrote:
> On 03/30/2016 04:27 AM, wolfrage8...@gmail.com wrote:
>>>
>>> I have a few students who are interested in creating interactive games in
>>> Python. We have learned how to use tkinter but we are looking for
>>> something more robust. I tried using pygame 
>>
>> I recommend Kivy; because then it is easy to take the app from
>> computer to Phone; which opens the world of touch devices!
>> Though not specifically made for games it works very well for my
>> purposes which are a game.
>>
> I believe Kivy requires pygame so he would get the same error.

Since Kivy 1.9 the requirement for pygame has been dropped and they
are now using OpenGL instead.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-30 Thread john

On 03/30/2016 04:27 AM, wolfrage8...@gmail.com wrote:

I have a few students who are interested in creating interactive games in
Python. We have learned how to use tkinter but we are looking for
something more robust. I tried using pygame 

I recommend Kivy; because then it is easy to take the app from
computer to Phone; which opens the world of touch devices!
Though not specifically made for games it works very well for my
purposes which are a game.


I believe Kivy requires pygame so he would get the same error.

Johnf
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Best tool for programming interactive games in Python

2016-03-30 Thread wolfrage8...@gmail.com
>I have a few students who are interested in creating interactive games in
>Python. We have learned how to use tkinter but we are looking for
> something more robust. I tried using pygame 

I recommend Kivy; because then it is easy to take the app from
computer to Phone; which opens the world of touch devices!
Though not specifically made for games it works very well for my
purposes which are a game.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor