Answer:
See explaination
Explanation:
def readFileFirstLast(filename):
# doc string
''' Function accept the filename and opens the fle
and reads all lines and strips new line character and
stores first and last in a string and return that string'''
#eception handle if file not found
try:
#opening the file
f = open(filename)
#reading the first line and striping the ne line
string = f.readline().strip()
#iterating until last line
for line in f:
pass
#concate the last line after strip the new line character to the string
string = string + " " + line.strip()
#return the string
return string
except:
#if file not found
return "File not found"
#taking the file name from user
filename = input("Enter a file name: ")
#printing the doc string in function
print("\ndoc_sting: \n"+ readFileFirstLast.__doc__+"\n")
#printing the returned string by calling the readFileFirstLast()
print("output string :")
print(readFileFirstLast(filename))
An administrator is writing into a database and received an error detailed in the exhibit. The two steps to be taken to resolve this are :
Move the Execute SQL statement to be between Connect and Disconnect. Move the Prompt Message to be before the Disconnect statements.
Explanation:
- Dynamic SQL refers to SQL statements that are generated at run-time.
- To disconnect from a database, in the Database Navigator or Projects view, click the connection and then click the Disconnect button in the toolbar or click Database -> Disconnect on the main menu
- You can also right-click the connection and click Disconnect on the context menu
- The PROMPT command may be used to display messages to the user, perhaps supplying a short summary of what your script is going to accomplish.
- The SQL EXECUTE command executes an SQL command and binds the result to 4D objects (arrays, variables or fields).
- A valid connection must be specified in the current process in order to execute this command. The sqlStatement parameter contains the SQL command to execute.
Answer:
DECLARE SUB SQUARE (N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL SQUARE(N)
END
SUB SQUARE (N)
S = N ^ 2
PRINT “SQUARE OF NUMBER “; S
END SUB
Because we have the domain name system (DNS). It registers friendly names, e.g., google.com that represent IP addresses. Your computer will consult a DNS service to query the IP address for a domain name you enter, and under-the-hood the connection is made to the IP address.