помогите пожалуйста​, зделать надо в пайтоне
Ответ
0 (0 оценок)
0
matysevuchvlad373 5 месяцев назад
Светило науки - 25 ответов - 0 раз оказано помощи

Відповідь:

def startup_functionality():

   def input_category():

       category = input("Enter the category of the startup project: ")

       return category

   def input_idea():

       idea = input("Enter the idea of the startup project: ")

       return idea

   def input_problem():

       problem = input("Enter the problem the startup aims to solve: ")

       return problem

   def input_budget():

       budget = float(input("Enter the budget for the startup project: "))

       return budget

   def plan_expenses():

       expenses = []

       while True:

           expense_name = input("Enter the expense name (or 'done' to finish): ")

           if expense_name.lower() == 'done':

               break

           expense_amount = float(input(f"Enter the amount for {expense_name}: "))

           expenses.append((expense_name, expense_amount))

       return expenses

   category = input_category()

   idea = input_idea()

   problem = input_problem()

   budget = input_budget()

   expenses = plan_expenses()

   print("nStartup Details:")

   print(f"Category: {category}")

   print(f"Idea: {idea}")

   print(f"Problem: {problem}")

   print(f"Budget: {budget}")

   print("Expenses:")

   for name, amount in expenses:

       print(f"- {name}: {amount}")

def investor_functionality():

   def choose_categories():

       categories = input("Enter desired categories separated by commas: ").split(',')

       return categories

   def provide_recommendations(categories):

       recommendations = {}

       for category in categories:

           recommendations[category] = input(f"Enter recommendations for {category}: ")

       return recommendations

   def identify_companies():

       companies = []

       while True:

           company_name = input("Enter the company name (or 'done' to finish): ")

           if company_name.lower() == 'done':

               break

           stability = input(f"Enter the stability of {company_name}: ")

           size = input(f"Enter the size of {company_name}: ")

           companies.append((company_name, stability, size))

       return companies

   categories = choose_categories()

   recommendations = provide_recommendations(categories)

   companies = identify_companies()

   print("nInvestor Details:")

   print("Categories and Recommendations:")

   for category, recommendation in recommendations.items():

       print(f"- {category}: {recommendation}")

   print("Companies:")

   for name, stability, size in companies:

       print(f"- {name}: Stability: {stability}, Size: {size}")

def main():

   while True:

       print("nWelcome to the Startup and Investor Tool")

       print("1. Startup Functionality")

       print("2. Investor Functionality")

       print("3. Exit")

       choice = input("Choose an option: ")

       if choice == '1':

           startup_functionality()

       elif choice == '2':

           investor_functionality()

       elif choice == '3':

           print("Exiting the program.")

           break

       else:

           print("Invalid choice. Please try again.")

       print("nInstructions:")

       print("1. Follow the prompts to input the required information.")

       print("2. Use 'done' when you have finished entering multiple entries (e.g., expenses, companies).")

       print("3. Choose the desired functionality from the main menu.")

if __name__ == "__main__":

   main()

Пояснення:

Остались вопросы?