-->
BLANTERWISDOM101

Devnet Moudle 1 Answer Key

Wednesday, January 20, 2021

Devnet Moudle 1 - Techpedal

1. A student new to Python is working in the interactive interpreter mode. The student issues the commands:

>>> IpAddress = { "R1":"10.1.1.1","R2":"10.2.2.1","R3":"10.3.3.1" }

Which data type is used to represent the variable ipAddress?

    a) Array
    b) Tuple
    c) List
    d) Dictionary

Answer: d) Dictionary

2. A student is learning Python and is reviewing a Python script as follows:

aclNum = int(input("What is the IPv4 ACL number? "))
if aclNum >= 1 and aclNum <= 99:
     print("This is a standard IPv4 ACL.")
elif aclNum >=100 and aclNum <= 199:
     print("This is an extended IPv4 ACL.")
else:
     print("This is not a standard or extended IPv4 ACL.")

Under which condition will the elif statement be evaluated?

    a) when the if statement is false
    b) when the first print statement fails
    c) when the input is a string
    d) when the input is a float number

Answer: a) when the if statement is false

3. What is displayed after the following code is entered into a Python interpreter?

addition = 22 +10
print(addition)

    a) (syntaxerror)-...as there should not be a space between the numerical values
    b) [22]+[10]
    c) 32
    d) nothing ( because the print command is wrong)

Answer: c) 32

4. A user issues a Linux command and the result is shown:

   total 40
   drwxr-xr-x 2 devasc devasc 4096 Mar 30 21:25 Desktop
   drwxr-xr-x 2 devasc devasc 4096 Apr 15 19:09 Documents
   drwxr-xr-x 2 devasc devasc 4096 Apr 15 19:09 Downloads
   drwxr-xr-x 5 devasc devasc 4096 Mar 30 21:21 labs
   drwxr-xr-x 2 devasc devasc 4096 Apr 15 19:09 Music
   drwxr-xr-x 2 devasc devasc 4096 Apr 15 19:09 Pictures
   drwxr-xr-x 2 devasc devasc 4096 Apr 15 19:09 Public
   drwxr-xr-x 5 devasc devasc 4096 Mar 30 21:24 snap
   drwxr-xr-x 2 devasc devasc 4096 Apr 15 19:09 Templates
   drwxr-xr-x 2 devasc devasc 4096 Apr 15 19:09 Videos
   devasc@labvm:~$ 

Which Linux command is used to display the contents of the current directory as shown?

    a) ls -l
    b) ls -lr
    c) ls -a
    d) ls

Answer: a) ls -l

5. A system administrator attempts to determine what is causing a computer to perform slower than normal. The administrator issues the ps command. What is displayed by this command?

    a) current RAM usage
    b) active processes using CPU time
    c) current NIC status
    d) current HDD usage

Answer: b) active processes using CPU time

6. A user issues a series of Linux commands as shown.

(omitted)$ pwd
/home/devasc/labs/ansible/backups
(omitted)$ cd ../..

Which directory is the current directory after the cd command is entered?

    a) /home
    b) /home/devasc/
    c) /home/devasc/labs
    d) /home/devasc/labs/ansible

Answer: c) /home/devasc/labs

7. What is the output when the following code is entered into a Python program interpreter?

[1,2,4,5] + [3,6]

    a) [1,2,4,5,3,6]
    b) [1,2,3,4,5,6]
    c) [21]
    d) [12]+[9]

Answer: a) [1,2,4,5,3,6]

8. A Linux administrator is attempting to use a terminal to configure the network interface card on a computer. The administrator receives a message that the administrator does not have necessary permissions to perform the configuration. What should be done prior to the configuration command?

    a) use the sudo command
    b) use a different user account
    c) change the chmod permissions on the network configuration file
    d) identify a different network interface

Answer: a) use the sudo command

9. A user enters the commands as shown. What is the result after the mv command is entered?

devasc@labvm:~/Documents$ pwd
/home/devasc/Documents
devasc@labvm:~/Documents$ mv myfile.sh ../Desktop/myfile2.sh

Which directory is the current directory after the cd command is entered?

    a) The file myfile.sh is moved to the /home/devasc/Desktop directory and renamed as myfile2.sh.
    b) The file myfile.sh is copied to the /home/devasc/Desktop directory and replaces the file myfile2.sh.
    c) The file myfile.sh is copied to the /home/devasc/Desktop directory and renamed as myfile2.sh.
    d) The file myfile.sh is copied and renamed to myfile2.sh in the current directory.

Answer: a) The file myfile.sh is moved to the /home/devasc/Desktop directory and renamed as myfile2.sh.

10. A Linux system administrator is searching the passwd file for any username that starts with a digit. Which grep command should the administrator use?

    a) grep '^[0-9]' /etc/passwd
    b) grep '{0-9}' /etc/passwd
    c) grep '_[0-9]' /etc/passwd
    d) grep '[0-9]' /etc/passwd

Answer: a) grep '^[0-9]' /etc/passwd

11. A student new to Python is working in the interactive interpreter mode. The student issues the command:

>>> ipAddress = {"R1":"10.1.1.1","R2":"10.2.2.1","R3":"10.3.3.1"}

Which Python expression can be used to retrieve the IP address of R2?

    a) ipAddress{'R2'}
    b) ipAddress[R2]
    c) ipAddress{"R2"}
    d) ipAddress['R2']

Answer: d) ipAddress['R2']

12.A user issues the Linux command ls -l myfile.sh to check the permission of the file myfile.sh.

devasc@labvm:~/Documents$ ls -l myfile.sh
-rwxr-xr-- 1 self test 15 Mar 30 21:24 myfile.sh

Which two statements describe the permissions assigned to the file? (Choose two.)

    a) Any user in the self group can read, modify, and execute the file.
    b) The user with the user ID of self can modify the file.
    c) The user with the user ID of devasc can modify the file.
    d) All users can execute the file.
    c) Any user in the test group can execute the file.

Answer: b) The user with the user ID of self can modify the file.
or
c) Any user in the test group can execute the file.

13. A system administrator issues the apt-get upgrade on a Linux operating system. What is the purpose of this command?

    a) A specific application named upgrade will be installed.
    b) Operating system updates are downloaded and will be installed.
    c) The remote repository of applications and dependencies will be updated to the latest version.
    d) Every application installed will update itself to the latest version.

Answer: d) Every application installed will update itself to the latest version.

14. A network engineer needs to review the status of all network interfaces of a server running a Linux operating system. The engineer enters the command ifconfig -a. What is the result of this command?

    a) The ARP table of the computer will be displayed.
    b) Both active and inactive interfaces will display information.
    c) All active interfaces will display information.
    d) The host routing table will be displayed.

Answer: b) Both active and inactive interfaces will display information.

15. Which Python command creates a conditional control structure?

    a) if
    b) def
    c) from
    d) delay

Answer: a) if

16. A student new to Python is working in the interactive interpreter mode. The student issues the commands:

>>> devicenames=["RT1", "RT2", "SW1", "SW2"]
>>> hostnames=devicenames + ["RT3", "SW3"]
>>> del hostnames[3]
>>> hostnames

What is the result?

    a) ['RT1', 'RT2', 'SW1', 'RT3', 'SW3']
    b) ['RT1', 'RT2', 'SW2', 'RT3', 'SW3']
    c) ['RT1', 'RT2', 'RT3', 'SW2', 'SW3']
    d) ['RT1', 'RT2', 'SW1', 'SW2', 'SW3']

Answer: a) ['RT1', 'RT2', 'SW1', 'RT3', 'SW3']

17. A student is learning Python in the interactive interpreter mode. The student issues the commands:

>>> y=2
>>> y*3
6
>>> 'Test'*y

What is the result?

    a) TypeError: A string type cannot be multiplied by an integer.
    b) 'TestTestTestTestTestTest'
    c) 'Test2'
    d) 'TestTest'

Answer: d) 'TestTest'
Share This :
Rajeshwaran

Rajeshwaran is a blogger who is always fascinated with technology and the amount of knowledge he can gather from the internet. He is trying to nerdify everyone around him with that same knowledge, through his writings. Website: Techpedal

0 Comments