Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Topic: Files
You have to perform file operations in different modes using python code on text file.
you can use any piece of information like groceries, books inventory, bank transactions and build your scenario on that, use text files for putting in the data.
Lab scenario:
1. You will have to perform read, write, append modes on your text file. (35 points, each mode 10 points).
2. Use all the possible functions for read and write.
3. Create a scenario, use “with” for manipulating the file and mention what your code is
intended to do. (15 points).
Submission:
Three files have to be submitted
1. Text file having your data (EC4_lastname.txt)
2. Word document what explain your data and what each mode is doing.
(EC4_lastname.doc)
3. Python file where you have your code. (EC4_lastname.py)
Topic: Files
You have to perform file operations in different modes using python code on text file.
you can use any piece of information like groceries, books inventory, bank transactions and build your scenario on that, use text files for putting in the data.
Lab scenario:
1. You will have to perform read, write, append modes on your text file. (35 points, each mode 10 points).
2. Use all the possible functions for read and write.
3. Create a scenario, use “with” for manipulating the file and mention what your code is
intended to do. (15 points).
Submission:
Three files have to be submitted
1. Text file having your data (EC4_lastname.txt)
2. Word document what explain your data and what each mode is doing.
(EC4_lastname.doc)
3. Python file where you have your code. (EC4_lastname.py)
In this assignment, you will use all of the graphics commands you have learned to create an animated scene. Your program should have a clear theme and tell a story. You may pick any school-appropriate theme that you like.

The program must include a minimum of:

5 circles
5 polygons
5 line commands
2 for loops
1 global variable
In this assignment, you will use all of the graphics commands you have learned to create an animated scene. Your program should have a clear theme and tell a story. You may pick any school-appropriate theme that you like.

The program must include a minimum of:

5 circles
5 polygons
5 line commands
2 for loops
1 global variable
Use the code snippet provided below as the basis for your work on each question in Assignment 6. Note that you may need more than two for loops for shapes in some of the questions.
Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that both arguments to is_power are positive integers. Note that the only positive integer that is a power of "1" is "1" itself.
After writing your is_power function, include the following test cases in your script to exercise the function and print the results:
print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3))
You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted. Don’t forget to include descriptive comments in your Python code.
rite a new recursive function countup that expects a negative argument and counts “up” from that number. Output from running the function should look something like this:
Deeply nested conditionals can become difficult to read. Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent single conditional.
1. Copy the countdown function from Section 5.8 of your textbook.
def countdown(n):
if n <= 0:
print('Blastoff!')
else:
print(n)
countdown(n-1)
Write a new recursive function countup that expects a negative argument and counts “up” from that number. Output from running the function should look something like this:
>>> countup(-3)
-3
-2
-1
Blastoff!
Write a Python program that gets a number using keyboard input. (Remember to use input for Python 3 but raw.)
Provide the following.
The code of your program.
Output for the following input: a positive number, a negative number, and zero.
An explanation of your choice for what to call for input of zero.
2. Write your own unique Python program that has a runtime error. Provide the following.
The code of your program.
Output demonstrating the runtime error, including the error message.
An explanation of the error message.
An explanation of how to fix the error.
Write your own unique Python program that has a runtime error. Do not copy the program from your textbook or the Internet. Provide the following.

The code of your program.
Output demonstrating the runtime error, including the error message.
An explanation of the error message.
An explanation of how to fix the error.
LATEST TUTORIALS
APPROVED BY CLIENTS