<span>Dispute who should be the leader of the Muslims after the death of Mohammed.<span> </span></span>
If the question is asking whether it is true or false, the
answer is false because worms are not responsible for disguising when they are
sending data by using bogus ip addresses but it is the Trojan horses in which
they are the one responsible for misleading users from the true intent or the
real data.
Answer:
price = float(input("Enter amount of a purchase: "))
shipping_price = 0.12* price
NJ_sales_Tax = 0.07*price
print('The price of item is {}'.format(price))
print('The Cost of Shipping is {}'.format(shipping_price) )
print('New Jessey Sales Tax is {}'.format(NJ_sales_Tax))
total_bill = shipping_price+NJ_sales_Tax+price
print('Total Bill {} ' .format(total_bill))
Explanation:
- Prompt User for input of the amount of purchase
- Calculate the shipping cost (12% of purchase price)
- Calculate the tax (7% of the purchase price)
- Use python's .format method to output an itemized bill
Answer:
- food_category = {
- "Fruits": ["Apple", "Strawberries", "Orange"],
- "Vegetables": ["Carrots", "Peas", "Onions"],
- "Meats": ["Chicken", "Beef", "Mutton"]
- }
-
- for cat in food_category:
- output = cat + ": "
- for food in food_category[cat]:
- output += food + ", "
- print(output)
-
- answer = input("Do you want to add category or food (Y - Yes N - No): ")
-
- while(answer == "Y"):
- choice = input("New Category (N) or New Food (nf): ")
-
- if(choice == "N"):
- new_cat = input("Enter new category name: ")
- if(new_cat not in food_category):
- food_category[new_cat] = ""
- elif(choice == "nf"):
- cat = input("Enter category: ")
- new_food = input("Enter new food name: ")
- food_category[cat].append(new_food)
-
- answer = input("Do you want to add new category or food (Y - Yes N - No): ")
-
- print("All food categories: ")
- for cat in food_category:
- print(cat)
-
- selected_cat = input("Select a category to view the food list: ")
- output = ""
- for food in food_category[selected_cat]:
- output += food + ", "
- print(output)
Explanation:
The solution code is written in Python 3.
Firstly, create a food category dictionary data structure (Line 1 -5). Next, display all the food category and the food in each category (Line 7 - 11)
Next prompt user to feedback if they wish to add new category or new food (Line 13).
While the answer is yes prompt user to enter their choice, either category or food and use if else if statements to handle the choice made by the user. If the choice is new category, prompt user to enter new category name and check if the new category is already exist in the dictionary. If not, add that category to dictionary (Line 18 - 21).
If the choice is food, nf, prompt user to input food category and enter the new food name and add it to the food_category list (Line 22 - 25).
After that prompt user to enter if they wish to continue to add new data (Line 27).
After collecting all info from user, write a for loop to display all the categories (Line 29 - 31).
At last, prompt user to select a category and display all the food of the selected category (Line 33 - 37).