+ 2
answer plz
How many characters would be in each line printed by this code, if one character is one byte? file = open("filename.txt", "r") for i in range(21): print(file.read(4)) file.close()
27 Respuestas
+ 11
the correct answer is 2, 4/2= 2
+ 9
Explanation
This code will loop for 21 lines that are from 0 to 20. On each line, it will read 4 bytes ( i.e. if each character is of 1 byte then it will read 4 characters from each of the 21 lines).
And according to the question, the answer is 4, as it is asking the number of characters that is going to be printed in each line NOT the total number of characters.
+ 5
the answer is 4
+ 2
answer is 2 .
one character is of two bytes then
read argument have (4)
then 4/2 = 2
+ 1
4
+ 1
The answer is 4
+ 1
answer is 4
+ 1
4
+ 1
2
+ 1
Answer Is 4.
+ 1
Please the answer is 4 not 2
+ 1
the answer is 2
0
the answer is 2
0
the answer is 2
0
Answer is "2"
0
How many characters would be in each line printed by this code, if one character is one byte?
file = open("filename.txt", "r")
for i in range(21):
print(file.read(4))
file.close()
4
0
ur mum
0
Why do I get an error when I ran this code?
0
The answer is 2
0
Thank you...