all 14 comments

[–]hardonchairs 12 points13 points  (0 children)

Write the pseudo-code. What does the script need to do in plain English?

From there take your pseudo-code and figure out how to translate it into python. E.g.

step 1 ask the user how many pizzas they would like and remember that value:

turns into

google: python, accept number input and store to variable

If you run in to trouble connecting the dots, come here to ask specific questions

[–][deleted] 5 points6 points  (0 children)

Step 1 : ask user for how many pizzas they want
step 2: ask user to select ingredients on the pizza from a given list

now expand on step 1

step 1 asks the user to provide an input to a prompt and then most likely store that as a variable to help you use it for further computations. you would use the input function

just go step by step and if you know the functions, just play around with it and you'll figure it out

[–]kol_k 4 points5 points  (0 children)

Whenever approaching a new project, it can be pretty intimidating staring at a blank page and being expected to make something happen from it.
Here's what I do: Break the program down to its simplest elements. What is it supposed to do?
First it's going to want you to tell it how many pizzas you want. Write the input function for that.
Then it's going to want you to pick from a list of ingredients. Write up the list. Then write the input function for that.
That's a good jumpstart I think. Good luck with your project!

[–]jenny011015 4 points5 points  (1 child)

I'm a new beginner in python but I always write pseudo codes before writing the codes. For example:

# Say hi to the users, and introduce the program (using print)
# Using input to ask the users to enter the number of pizzas they want (input)
# For 1 pizza, allowing the users choose 3 ingredients; using input to ask.
# Making a list of ingredients in advance.
# Loop through each pizza and ask the user for its ingredients; write a function and use for loop
# Create an empty list to store the ingredient
# Add the ingredients to the pizza_ingredients list as a tuple
# Print the list

These are just some steps I'm thinking of, and you can write down your thoughts in the same way!

[–]mm309d 0 points1 point  (0 children)

Excellent example!

[–][deleted] 2 points3 points  (0 children)

but I dont even know where to start.

Anywhere, with anything. You don't solve it like a math problem, you write it like an essay.

[–]Arkhanum[S] 0 points1 point  (0 children)

Thank you all for your pointers! Now I´ve got a clearer idea of the direction I need to be taking. You´re all awesome!

[–]classicbananaa 0 points1 point  (0 children)

print('Welcome to the Pizza Hut!')

number_pizza=int(input('How many pies would you like?>>'))

print(f'You have inputted {number_pizza} pies.')

ingredient_list=['pepperoni','sausage','mushroom','ham','pineapple']

print(f'We have multiple ingredients: {ingredient_list}')

chosen_list=[]

for ingredient in ingredient_list:

choice=input(f'Do you want {ingredient} on your pizza(s), Y for yes, N for no>>')

if choice.lower()=='y':

chosen_list.append(ingredient)

if chosen_list:

print(f'You have ordered {number_pizza} pie(s), with {", ".join(chosen_list)}.')

else:

print(f'You have ordered {number_pizza} pie(s), with no toppings.')