1answer.
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
rjkz [21]
3 years ago
10

How do i move a file in python3

Computers and Technology
1 answer:
Levart [38]3 years ago
6 0

Answer:

To move a file in Python, we will need to import the os and shutil modules that provide us the ability to copy, move, and remove files in Python. Both of these modules provide methods to do so, although in many cases the shutil module has more convenient methods.

Keep in mind that the destination directory needs to exist in order for this example to work. Once you've set up the directories "d1" and "d2" (or just changed the example to fit your directory structure), run the code. Now check out the "d2" directory and you should see the xfile.txt if now present in that directory.

You might be interested in
The MIQ inventory measures how much you value status. Which two measures are measures of status?
Alika [10]
It would be the social standing of a person and the economic standing of a person. 
6 0
3 years ago
One of the disadvantages of Photoshop Express is that it does not have a Black and White effect. True False
Katarina [22]
False,
The Pop Color tool can be used to select one particular color, changing the rest of the image to black and white. The effects available in Photoshop Express don't allow for a huge amount of customization
8 0
3 years ago
If all humans started from one tiny cell why do you think we all look and act differently
scZoUnD [109]
The one cell evolved into different categories by adapting to its human/animal/plant’s habitat
3 0
3 years ago
For this problem, you will write a function standard_deviation that takes a list whose elements are numbers (they may be floats
Evgesh-ka [11]

Answer:

  1. import math  
  2. def standard_deviation(aList):
  3.    sum = 0
  4.    for x in aList:
  5.        sum += x  
  6.    
  7.    mean = sum / float(len(aList))
  8.    sumDe = 0
  9.    for x in aList:
  10.        sumDe += (x - mean) * (x - mean)
  11.    
  12.    variance = sumDe / float(len(aList))
  13.    SD = math.sqrt(variance)
  14.    return SD  
  15. print(standard_deviation([3,6, 7, 9, 12, 17]))

Explanation:

The solution code is written in Python 3.

Firstly, we need to import math module (Line 1).

Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).

We can test the function using a sample list (Line 20) and we shall get 4.509249752822894

If we pass an empty list, a ZeroDivisionError exception will be raised.

3 0
3 years ago
What is the ascii code for the letter D
PilotLPTM [1.2K]

Answer:

068

Explanation:

Or if you want binary it's 01000100

4 0
2 years ago
Other questions:
  • A windows computer is shared between several users, each with his own local user account. Each user has his own dedicated, uniqu
    9·1 answer
  • Typohunting is registering a domain name that is similar to a trademark or domain name but that is slightly misspelled in hopes
    5·1 answer
  • Alkane is a Variety of which fruit
    6·1 answer
  • Which of the following can potentially be changed when implementing an interface?
    13·1 answer
  • In C++ Please :
    6·1 answer
  • Your bluetooth headset is waiting for another bluetooth device to locate its signal. what is this mode known as?'
    8·1 answer
  • Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per li
    11·1 answer
  • Creating a chart using a spreadsheet Chart Wizard involves four steps. Which is the last step?
    6·1 answer
  • Select the correct answer.
    9·2 answers
  • If there is a secure socket layer in place, what will you need in addition to a user id in order to access the shared files?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!