python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Why is my for loop not adding all values to the dictionary?
def biggest_family(fil):
with open(fil) as file:
name = {}
ans = {}
text = file.read().split("\n")
for i in range (0 , len(text)-1):
first = t...
Michael Stewart
Votes: 0
Answers: 2
How can I make it so my program, for each word read in a string, also reads the following word?
I want my Java program to do the following thing:
Whenever it reads a file like the following
Bob went to the store to buy apples.
To read each word in the string (delimited by only a single space ch...
Acacia Dune
Votes: 0
Answers: 1
Can I read the last line from txt file when the file's size change? (in python)
I used this:
while (True):
with open('filename.txt') as f:
for line in f:
pass
last_line_char = line[0]
But I want to read when the file's last line or size is change....
user17426707
Votes: 0
Answers: 1
Reading from file without using string
I am doing a school project where we must not use std::string. How can I do this? In the txt file the data are separated with a ";", and we do not know the length of the words.
Example:
appl...
petizana
Votes: 0
Answers: 1