## CapsuleMantis62's Profile User Rating:

Reputation: -1 Dishonored
Group:
New Members
Active Posts:
8 (0.01 per day)
Joined:
16-May 12
Profile Views:
104
Last Active:
Jun 07 2012 02:47 PM
Currently:
Offline

### Previous Fields

Dream Kudos:
0
CapsuleMantis62 has not set their status

1. #### In Topic: One line fix up can anyone help?

Posted 24 May 2012

Tayacan, on 24 May 2012 - 12:32 PM, said:

Just for the sake of demonstrating:

```>>> Pizza = '27'
>>> if Pizza != '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9' or '10' or '11' or '12':
print("Invalid Pizza Number")

Invalid Pizza Number
>>> Pizza = '3'
>>> if Pizza != '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9' or '10' or '11' or '12':
print("Invalid Pizza Number")

Invalid Pizza Number

```

I'm pretty sure 3 is a just fine input.

if u dont see but it has a '!' in line '8' on yours.
```if Pizza != '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9' or '10' or '11' or '12':
```

after pizza
2. #### In Topic: One line fix up can anyone help?

Posted 24 May 2012

Tayacan, on 24 May 2012 - 03:52 AM, said:

You also need to read up on your if-elif-else's, as well as or.

```elif Pizza != '1' or '2' or '3' or '4' or '5' or '6' or '7' or '8' or '9' or '10' or '11' or '12':
```

The above doesn't do what you think it does. It evaluates each thing between the or's to either True or False - is a string True or False?

it works for me how i want it to
3. #### In Topic: how can i make this code smaller and working?

Posted 23 May 2012

```#What pizza's. Delivery or pick up?
#IF THE ORDER IS FOR DELIVERY:
#A 3\$ delivery charge to be added to the total cost.
#Get customers name, address and phone number (contact details).
#Show pizza's and prices.

#IF THE ORDER IS FOR PICK UP:
#Get customers name.
#Show pizza's and prices.

a = ("8.50")
b = ("13.50")
def hi1 ():
pass
while True:
try:
Pizza = (input("how do you want to recive the pizza's?...Delivery = 1 or Pick up = 2 "))
if Pizza == '1':
Delivery = (input("What's your name? "))
Delivery_con = (input("What's your contact details? "))
break
if Pizza == '2':
Pick_up = (input("What's your name? "))
Pick_up_con = (input("whats your contact details"))
break
elif Pizza != '1' or '2':
print ("You need to tell me if you want it Delivered or Pick up!")
except:
pass

def hi2 ():
pass
while True:
try:
Pizza = (input("hello"))
if Pizza == '3':
print ("...")
break
if Pizza == '4':
print ("......")
break
elif Pizza != '1' or '2':
print ("You need to tell me if you want it Delivered or Pick up!")
except:
pass
```
4. #### In Topic: how can i make this code smaller and working?

Posted 22 May 2012

[quote name='Tayacan' date='21 May 2012 - 05:32 AM' timestamp='1337603542' post='1627335']
```book_cost = 24.95
discount = .6
shipping_first_book = 3
copys = .75
print ("Ryan, 12th of March 2012. Bookstore costing calculator")
print ("Welcome to your book supplier.")
print ("Books cost \$24.95 each")
print ("The first book cost \$3 to ship and extra copys cost only .75c")
def hi ():
pass
while True:
try:
books = int(input("How many books do you want to order? "))
break
except ValueError:
pass

print ("Sorry. What ever you said is not a number, try again!")
def hi2 ():
pass
while True:
try:
Shop = (input("Are you a shop owner? (Yes or No) "))
if Shop == 'yes':
print ("Since you are bookstore owner, you get a 40% discount.")
print ("It's going to cost you...")
print ("\$",(books * book_cost) * (discount) + (books * copys) - (copys) + shipping_first_book)
print (("Thank u for odering") , books ,"books")
break
if Shop == 'no':
print ("It's going to cost you...")
print ("\$",(books * book_cost) + (books * copys) - (copys) + shipping_first_book)
print (("Thank you for odering") , books ,"book(s)")
break
elif Shop != 'yes' or 'no' or 'Yes' or 'No' or 'n' or 'y':
print ("You need to tell me if you are a shop owner or not, not just giving me random letters, it is not appropriate!")

except:
pass

```

how come this one works then?

Member Title:
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

E-mail:
Private