I need someone to review and improve this code.
import time
import os, signal
User_Name = (input("What is your name?: ")) # If blank twice, sets to John
if User_Name == '':
print("Please enter a name")
time.sleep(1)
User_Name = (input("What is your name?: "))
if User_Name == '':
User_Name = "John"
Computer_Name = (input("What will my name be?: ")) # If blank twice, sets to HELPER
if Computer_Name == '':
print("Please enter a name")
time.sleep(1)
Computer_Name = (input("What will my name be?: "))
if Computer_Name == '':
Computer_Name = "HELPER"
def GREET():
print('Hey, ' + User_Name + '!' + ' I am ' + Computer_Name + '! What can I help you today?')
print("(Please use HTML tags WITH < and > when using this help tool.)")
def HELPTOOL():
User_Input = input(User_Name + ": ")
if User_Input == 'help':
print("")
print(User_Name + ", please enter a tag, such as <p>, ")
time.sleep(0.1)
print("to display what that tag is.")
time.sleep(0.1)
print("")
print("Type 'about' or 'contact' for more information ")
time.sleep(0.1)
print("")
HELPTOOL()
elif User_Input == 'restart':
time.sleep(0.1)
print("")
print("RESTARTING..")
print("")
time.sleep(0.1)
time.sleep(0.1)
time.sleep(0.1)
time.sleep(0.1)
time.sleep(0.1)
for i in range(1):
GREET()
elif User_Input == 'about':
print("")
print("This tool was orginally made to help HTML progr")
time.sleep(0.1)
print("ammers understand the different tags in the gre")
time.sleep(0.1)
print("at language of HTML")
time.sleep(0.1)
print("")
HELPTOOL()
elif User_Input == 'contact':
print('')
time.sleep(0.1)
print("Email: ****@gmail.com")
time.sleep(0.1)
print("")
HELPTOOL()
elif User_Input == '<p>':
print("-----------------------------------------------")
time.sleep(0.1)
print("The <p> tag defines a PARAGRAPH. Browsers autom")
time.sleep(0.1)
print("aticlly add some space (margin) before and afte")
time.sleep(0.1)
print("r each <p> element. The margins can be modified")
time.sleep(0.1)
print("with CSS (with the margin properties)")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<div>':
print("-----------------------------------------------")
time.sleep(0.1)
print("The <div> tag is used to create a 'box' that co")
time.sleep(0.1)
print("ntains everything that you put between these ta")
time.sleep(0.1)
print("gs: <div> </div>. This can be used for creating")
time.sleep(0.1)
print("interactive menus, navigations bars, and more!")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == 'tags':
print("-----------------------------------------------")
time.sleep(0.1)
print("Tags. They are the very foundation of this lang")
time.sleep(0.1)
print("uage itself! These tags are the hidden elements")
time.sleep(0.1)
print("that define how your web browser must format an")
time.sleep(0.1)
print("d display the content. Nearly all these 'tags' ")
time.sleep(0.1)
print("have two parts: The opening tag EX. <p>, and Th")
time.sleep(0.1)
print("e closing tag EX. </p>. These create all of the")
time.sleep(0.1)
print("content you see on sites such as Google.")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<!--...-->':
print("-----------------------------------------------")
time.sleep(0.1)
print("The <!--...--> tag (or comment tag) creates a c")
time.sleep(0.1)
print("omment, and therefore hiding that text or code ")
time.sleep(0.1)
print("from the browser. Comments can be used for a va")
time.sleep(0.1)
print("riety of things, from saving certain bits of co")
time.sleep(0.1)
print("de for later, to explaining what something does")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<!DOCTYPE html>':
print("-----------------------------------------------")
time.sleep(0.1)
print("This tag is the declaration of an HTML document")
time.sleep(0.1)
print(". It tells the browser 'Hey, im an HTML Docume")
time.sleep(0.1)
print("nt!' (Not literally)")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<a>':
print("-----------------------------------------------")
time.sleep(0.1)
print("This tag defines a hyperlink. This is used when")
time.sleep(0.1)
print("you want to create text that, when clicked, wil")
time.sleep(0.1)
print("l redirect you to a differect page, or download")
time.sleep(0.1)
print("a file.")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<abbr>':
print("-----------------------------------------------")
time.sleep(0.1)
print("<abbr> is used to abbreveate things, such as CD")
time.sleep(0.1)
print("C or FBI.")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == 'exit':
print("Shutting Down...")
time.sleep(1.5)
os.kill(os.getpid(), signal.SIGTERM)
elif User_Input == '<h>':
print("-----------------------------------------------")
time.sleep(0.1)
print("The <h> tag is used to create a header, which i")
time.sleep(0.1)
print("s text that is seperated from the rest, and app")
time.sleep(0.1)
print("ears at the top of the webpage or document.")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<address>':
print("-----------------------------------------------")
time.sleep(0.1)
print("This tag defines the contact information, or AD")
time.sleep(0.1)
print("DRESS of the owner of the document. ")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<b>':
print("-----------------------------------------------")
time.sleep(0.1)
print("This defines BOLD text. This has a specific use")
time.sleep(0.1)
print(", such as (<p>Hello <b>World</b>!</p>)")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<body>':
print("-----------------------------------------------")
time.sleep(0.1)
print("Defines the BODY of an HTML document. ")
time.sleep(0.1)
print("-----------------------------------------------")
HELPTOOL()
elif User_Input == '<br>':
print("-----------------------------------------------")
time.sleep(0.1)
else:
time.sleep(0.1)
print("Sorry, I didn't catch that..")
time.sleep(0.1)
HELPTOOL()
GREET()
HELPTOOL()
This code's purpose is to help HTML programmers grasp the knowledge of the HTML tags, and how to use them.