answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
-Dominant- [34]
2 years ago
10

The parent_directory function returns the name of the directory that's located just above the current working directory. Remembe

r that '..' is a relative path alias that means "go up to the parent directory". Fill in the gaps to complete this function.
import os
def parent_directory():
# Create a relative path to the parent
# of the current working directory
dir = os.getcwd()
relative_parent = os.path.join(dir, ___)
# Return the absolute path of the parent directory
return os.path.dirname(relative_parent)
print(parent_directory())
Computers and Technology
1 answer:
dedylja [7]2 years ago
6 0

Answer:

Following are the complete code to this question:

import os #import package  

def parent_directory():#defining a method parent_directory

   dir = os.getcwd()#defining dir that stores the getcwd method value  

   relative_parent = os.path.join(dir) #defining relative_parent variable that uses join method to adds directory

   return os.path.dirname(relative_parent)#use return keyword to return directory name

print(parent_directory())#use print method to call parent_directory method

Output:

/

Note:

This program is run the online compiler that's why it will return "/"

Explanation:

In the given Python code, we import the "os" package, after that a method "parent_directory" is defined, which uses the dir with the "getcwd" method that stores the current working directory.  

  • After that "relative_parent" variable is declared, which uses the join method to store the directory value and use the return keyword to returns its value.  
  • In the next step, the print method is used, which calls the method.
You might be interested in
Suppose that a class named ClassA contains a private nonstatic integer named b, a public nonstatic integer named c, and a public
Rus_ich [418]

Answer:

b. obA.c 5;

d. ClassA.b=23;

f. ClassA.d = 99;

Explanation:

Java is a programming language for object oriented programs. It is high level programming language developed by Sun Microsystems. Java is used to create applications that can run on single computer. Static variable act as global variable in Java and can be shared among all objects. The non static variable is specific to instance object in which it is created.

6 0
2 years ago
Gaven's instructor told him to include a personal statement in his work portfolio. Why did his instructor recommend including a
algol [13]
The recommendation of the instructor for Gaven to include a personal statement in his work portfolio will allow him to identify his career goals. If he is unable to show this to his work portfolio then he may simply state it in the personal statement. Thus, the answer to this item is letter A. 
3 0
2 years ago
1A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The
Sedaia [141]

Answer:

EMI (Electromagnetic Interference).

RFI (Radio Frequency Interference).

Explanation:

The new ethernet cable is installed near the ceiling and it is close to fluorescent lights and electrical equipment.Since the ethernet cable is carrying corrupt and distorted data so it needs protection.The protection  should be from EMI(Electromagnetic Interference) and RFI(Radio Frequency Interference).

8 0
2 years ago
James has created some artwork portraying life on a different planet. He wants to show a world where everything is beautiful and
PIT_PIT [208]
What are the answer choices if so can you please post it with answer choices ?
5 0
2 years ago
A natural language processor reads the sentence The walk was tiring and mistakes the noun “walk” as a verb. What is such an erro
Ray Of Light [21]

Answer: Which of these is a compound morphology? (A. bookkeeper = book + keeper)

The software first uses (NLU) to map and analyze the input. It then creates the output using (NLG).

(It works by mapping input to representation and analyzing them.)

What type of morphology does this follow? (D. derivational morphology)

What is such an error called? (C. lexical ambiguity)

Explanation: Plato

4 0
2 years ago
Other questions:
  • When ____ occur during preliminary debugging, dummy print statements—statements that are temporarily inserted into the code to d
    9·1 answer
  • The matrix theory is used in the ___ technique
    8·1 answer
  • QUESTION 2 of 10: New shoes are on SALE. You find a pair you like for $85 dollars. But you only have $45 with you. So, you pay $
    13·1 answer
  • Write a program that defines a type for a structure that stores information on a student in ENG EK 125. Declare two variables to
    8·1 answer
  • A method countDigits(int num) of class Digits returns the remainder when the input argument num(num > 0) is divided by the nu
    10·1 answer
  • Which broad area of data mining applications analyzes data, forming rules to distinguish between defined classes?
    13·1 answer
  • Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search.
    11·2 answers
  • Write a program that simulates the functionality of a vending machine having the following characteristics:• The vending machine
    11·1 answer
  • Which OS function does a CLI fulfill? A User interface B Running applications C Hardware interface D Booting
    8·1 answer
  • . Electricians will sometimes call ______ "disconnects" or a "disconnecting means."
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!