Answer:
What programming language is this
Explanation:
<span>The Union victory in the Civil War may have given some 4 million slaves their freedom, but African Americans faced a new onslaught of obstacles and injustices during the Reconstruction era (1865-1877). By late 1865, when the 13th Amendment officially outlawed the institution of slavery, the question of freed blacks’ status in the postwar South was still very much unresolved. Under the lenient Reconstruction policies of President Andrew Johnson, white southerners reestablished civil authority in the former Confederate states in 1865 and 1866. They enacted a series of restrictive laws known as “black codes,” which were designed to restrict freed blacks’ activity and ensure their availability as a labor force now that slavery had been abolished. For instance, many states required blacks to sign yearly labor contracts; if they refused, they risked being arrested as vagrants and fined or forced into unpaid labor. Northern outrage over the black codes helped undermine support for Johnson’s policies, and by late 1866 control over Reconstruction had shifted to the more radical wing of the Republican Party in Congress.</span>
Answer: Nooo! Dont!
Explanation:That is a bad idea!
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).
Answer:
Though the ENIAC patent was invalidated by the U.S. District Court in Minnesota, Eckert and Mauchly have nonetheless been credited by history with inventing the ENIAC, the world's first large-scale general purpose electronic computer
Explanation: