Python code executing but not running any of the command or giving any error

I am new to python. i learned coding just 2 weeks ago. I know many modules but i cannot know why this code is not executing or giving any error?

`import pyttsx3
import webbrowser as wb

import wikipedia

import sys

import time

import datetime

import requests

import json

from num2words import num2words

import openai

Setting up the OpenAI API credentials

openai.api_key = ‘i cant show my api key’

Setting the engine

engine = pyttsx3.init()
engine.setProperty(‘rate’, 100)

Setting the say function

def say(text):

Setting the function to take the command (tc= take command)

def tc():
return input("User: ")

Function to fetch a random joke from an API

def fetch_joke():
response = requests.get(“”)
joke_data = json.loads(response.text)
joke = joke_data[‘setup’] + " " + joke_data[‘punchline’]
return joke

say(“Hello, I am Milo! How may I help you?”)
while True:
valid_instruction = False # Set valid_instruction as False initially
query = tc()
sites = [[“youtube”, “”], [“wikipedia”, “”], [“google”, “”]]

# Check if the query matches a site to open
for site in sites:
    if f"Open {site[0]}".lower() in query.lower():
        say(f"Opening {site[0]}...")[1])
        valid_instruction = True

# Check if the query is to exit
if "exit".lower() in query.lower():
    say("Bye sir!")
    valid_instruction = True

# Check if the query is to search on Wikipedia
elif "search on wikipedia".lower() in query.lower():
    search_on_wiki = query.replace("search on wikipedia", "").strip()
        wiki = wikipedia.summary(search_on_wiki, sentences=2)
    except wikipedia.exceptions.DisambiguationError:
        say("There are multiple results for this query. Please be more specific.")
    except wikipedia.exceptions.PageError:
        say("Sorry, no results found for this query.")
    valid_instruction = True

# Check if the query is to search on YouTube
elif "search on youtube".lower() in query.lower():
    search_on_youtube = query.replace("search on youtube", "").strip()
    query_url = "" + search_on_youtube.replace(" ", "+")
    say("Searching on YouTube...")
    valid_instruction = True

# Check if the query is to perform calculations
elif "calculate".lower() in query.lower():
    calculation = query.replace("calculate", "").strip()
        result = eval(calculation)
        say(f"The result is {result}")
        say("Sorry, I couldn't perform the calculation.")
    valid_instruction = True

# Check if the query is to fetch a random joke
elif "tell me a joke".lower() in query.lower():
    joke = fetch_joke()
    valid_instruction = True

# Check if the query is to tell the time
elif "tell me the time".lower() in query.lower():
    current_time =
    hour = num2words(current_time.hour)
    minute = num2words(current_time.minute)
    time_in_words = f"It's {hour} {minute}"
    valid_instruction = True

elif "who made you".lower() in query.lower():
    say("I was built by Abhishek Meena! He is very good at coding")

# Chat with OpenAI
    response = openai.Completion.create(
        prompt=f'Abhishek: {query}\nMilo: ',
    reply = response.choices[0].text.strip()
    valid_instruction = True

# If the instruction is not valid, prompt the user again
if not valid_instruction:
    say("Invalid instruction. Please try again.")

#why is the code not running

i get this :

What exactly do you think should happen, step by step, when the code runs? Why?

the script should print (“Hello, I am Milo! How may i help you”) with the voice in my speakers and then i should be able to talk to it (text)