0 of 8 questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Your time:
Time has elapsed
Good work attempting the practice problems!
Please leave a comment below if you require any clarifications or send an email to [email protected] if you have any comments about this quiz.
You have completed this lesson!
Write a python program that reads 20 characters from a file and displays them?
Hint: To read X characters you can use read(X). This kind of method is rarely used though. You will mostly be reading the entire file (read() ) or one line at a time ( readline() ).
This response will be reviewed and graded after submission.
Write a python program that renames a file?
This response will be reviewed and graded after submission.
Write a python program that deletes an existing file?
This response will be reviewed and graded after submission.
Write a python program that prints the current directory of the program?
Hint:
“Current Working Directory” = cwd
Check the example on “creating folders/files” if you’ve forgotten this.
This response will be reviewed and graded after submission.
Write a python program that displays whether a file is properly closed or not?
This response will be reviewed and graded after submission.
Write a python program that displays in which mode the file is opened?
This response will be reviewed and graded after submission.
Write python program that takes the file name and type from the user and creates the file?
This response will be reviewed and graded after submission.
Write a python program that finds out the file extension from the file’s name?
Hint 1:
To get the file’s name recall that we can use file.name
Hint 2:
You can split a string based on a character by using “any string”.split(“.”)
This response will be reviewed and graded after submission.