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
VladimirAG [237]
2 years ago
13

Write an application that allows a user to enter a filename and an integer representing a file position. Assume that the file is

in the same folder as your executing program. Access the requested position within the file, and display the next 10 characters there.
Computers and Technology
1 answer:
hodyreva [135]2 years ago
8 0

The program is an illustration of file manipulations, where files are accessed, read and modified

<h3>The main program</h3>

The program written in Python, where comments are used to explain each action is as follows;

#This gets the file name

fname = input("Enter file name: ")

#This gets an integer value

num = int(input("Integer: "))

#This opens the file

file = open(fname, 'r')

#This initializes the number of characters to 0

count = 0

#This begins an iteration

while 1:

# This prints each character

print(file.read(1))

#This increases the number of characters printed by 1

count+=1

#When 10 characters are printed

if count == 10:

    #This closes the iteration

 break

#This closes the file

file.close()

Read more about file manipulations at:

brainly.com/question/16397886

You might be interested in
Anybody know how to code?
Anni [7]

▪︎An onscreen camera for drawing virtual images is called "turtle" in python language.

\hookrightarrowThe codes we will be using in the following algorithm are :

▪︎Turtle.left

▪︎Turtle.right

▪︎Turtle.move #upward

\hookrightarrow An algorithm to help the python turtle reach the finish line :

  1. Turtle.left
  2. Turtle.left
  3. Turtle.left
  4. Turtle.move#upward
  5. Turtle.move#upward
  6. Turtle.move#upward
  7. Turtle.right
  8. Turtle.right
  9. Turtle.move#upward
  10. Turtle.left
3 0
3 years ago
A large corporation uses:<br>LAN<br>WAN<br>Wireless network<br>Ethernet connection​
Katen [24]

Answer:

Probably would use LAN

Explanation:

Schools use LAN to connect students to their networks, so it would make sense for them to use LAN for offices. They could use ethernet if all their PCs are hard wired in, though.

3 0
4 years ago
Read 2 more answers
I really need help with this question, I can’t fail this please :) tysm
Maurinko [17]

Answer:

i think its the third one, i hope this helps

Explanation:

4 0
4 years ago
What is the main difference between a struct and a class?
Kay [80]

Explanation:

A class encapsulates methods, while a struct cannot.

4 0
3 years ago
IF ANSWER I WILL BE REALLY HAPPY
butalik [34]

Answer:

C.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Accessing programs and documents by way of icon
    12·1 answer
  • What will the following code display? #include using namespace std; void doSomething(int); int main() { int x{2}; cout &lt;&lt;
    9·1 answer
  • Before his job interview, Shabnam took the time to carefully wash and iron his best khaki pants and a button-down shirt. He even
    15·2 answers
  • What is the purpose of OPPA? A. It regulates the strength of passwords chosen by the users. B. It prohibits the use of informati
    11·1 answer
  • 4. You are planning to buy a new couch for your family room. Before you leave for the furniture store, you measure the available
    11·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRIST AND CORRECT
    10·2 answers
  • Which conditional tab would you use to add a quick style to a form or report? Arrange Design Format Page Setup
    7·1 answer
  • When using the Photo Album dialog box, a picture
    13·2 answers
  • What type of loop allows you to indicate the starting value for the loop control variable, the test condition that controls loop
    14·1 answer
  • What are the impacts of mobile phone?as well as the positive and negative impacts?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!