read() and readline()

4 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€42.44
List Price:  €59.42
You save:  €16.97
£36.60
List Price:  £51.25
You save:  £14.64
CA$68.04
List Price:  CA$95.27
You save:  CA$27.22
A$76.27
List Price:  A$106.78
You save:  A$30.51
S$63.65
List Price:  S$89.12
You save:  S$25.46
HK$392.39
List Price:  HK$549.39
You save:  HK$156.99
CHF 39.71
List Price:  CHF 55.60
You save:  CHF 15.88
NOK kr504.21
List Price:  NOK kr705.94
You save:  NOK kr201.72
DKK kr316.65
List Price:  DKK kr443.34
You save:  DKK kr126.68
NZ$82.47
List Price:  NZ$115.47
You save:  NZ$32.99
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.46
৳6,130.39
List Price:  ৳8,583.04
You save:  ৳2,452.64
₹4,289.22
List Price:  ₹6,005.26
You save:  ₹1,716.03
RM211
List Price:  RM295.42
You save:  RM84.42
₦76,481.70
List Price:  ₦107,080.50
You save:  ₦30,598.80
₨14,186.48
List Price:  ₨19,862.21
You save:  ₨5,675.73
฿1,614.65
List Price:  ฿2,260.64
You save:  ฿645.99
₺1,991.53
List Price:  ₺2,788.31
You save:  ₺796.77
B$271.03
List Price:  B$379.47
You save:  B$108.43
R880.57
List Price:  R1,232.87
You save:  R352.30
Лв83.02
List Price:  Лв116.24
You save:  Лв33.21
₩68,113.31
List Price:  ₩95,364.09
You save:  ₩27,250.77
₪167.41
List Price:  ₪234.39
You save:  ₪66.97
₱2,825.18
List Price:  ₱3,955.48
You save:  ₱1,130.30
¥7,222.17
List Price:  ¥10,111.61
You save:  ¥2,889.44
MX$931.33
List Price:  MX$1,303.94
You save:  MX$372.61
QR182.65
List Price:  QR255.72
You save:  QR73.07
P661.91
List Price:  P926.74
You save:  P264.82
KSh6,456.70
List Price:  KSh9,039.90
You save:  KSh2,583.20
E£2,462.42
List Price:  E£3,447.59
You save:  E£985.16
ብር6,935.52
List Price:  ብር9,710.29
You save:  ብር2,774.76
Kz45,586.35
List Price:  Kz63,824.54
You save:  Kz18,238.19
CLP$46,490.20
List Price:  CLP$65,090
You save:  CLP$18,599.80
CN¥358.19
List Price:  CN¥501.49
You save:  CN¥143.30
RD$2,990.88
List Price:  RD$4,187.47
You save:  RD$1,196.59
DA6,467.42
List Price:  DA9,054.91
You save:  DA2,587.48
FJ$111.93
List Price:  FJ$156.72
You save:  FJ$44.78
Q384.24
List Price:  Q537.97
You save:  Q153.72
GY$10,455.45
List Price:  GY$14,638.46
You save:  GY$4,183.01
ISK kr6,045.29
List Price:  ISK kr8,463.89
You save:  ISK kr2,418.60
DH448.55
List Price:  DH628.01
You save:  DH179.45
L841.80
List Price:  L1,178.59
You save:  L336.79
ден2,611.31
List Price:  ден3,656.05
You save:  ден1,044.73
MOP$404.06
List Price:  MOP$565.72
You save:  MOP$161.65
N$879.05
List Price:  N$1,230.75
You save:  N$351.69
C$1,838.94
List Price:  C$2,574.67
You save:  C$735.72
रु6,823.86
List Price:  रु9,553.95
You save:  रु2,730.09
S/177.20
List Price:  S/248.10
You save:  S/70.89
K206.42
List Price:  K289.01
You save:  K82.58
SAR187.47
List Price:  SAR262.48
You save:  SAR75
ZK1,210.60
List Price:  ZK1,694.94
You save:  ZK484.34
L214.70
List Price:  L300.60
You save:  L85.89
Kč1,045.99
List Price:  Kč1,464.47
You save:  Kč418.47
Ft16,941.11
List Price:  Ft23,718.91
You save:  Ft6,777.80
SEK kr477.95
List Price:  SEK kr669.17
You save:  SEK kr191.22
ARS$56,163.76
List Price:  ARS$78,633.76
You save:  ARS$22,470
Bs345.33
List Price:  Bs483.49
You save:  Bs138.16
COP$199,011.58
List Price:  COP$278,632.13
You save:  COP$79,620.55
₡25,237.26
List Price:  ₡35,334.18
You save:  ₡10,096.92
L1,305.67
List Price:  L1,828.05
You save:  L522.37
₲398,245.55
List Price:  ₲557,575.64
You save:  ₲159,330.08
$U2,005.70
List Price:  $U2,808.14
You save:  $U802.44
zł180.11
List Price:  zł252.17
You save:  zł72.06
Already have an account? Log In

Transcript

Hi and welcome back. In this video you will going to learn about how to use file dot read and file dot read line. File dot read it reads the entire file and returns it contained in the form of strength. reads at most size by strong the fight less if the raid hits e, f before operating says bytes if the size argument is negative, or omitted, do all the data until it's reached. Similarly read line is used to read an entire line from the file. Let's give a demonstration on these two methods.

See, I open Hello dot txt file and in which HelloWorld is written and using after read function and setting the size of read till 10. So it printed hello world not D, because it exceeds the size see 0123 456-789-1010 here it is printed. Suppose if I write 11 whole sentence A sprint here. Now let's do some changes. Instead of write, read, write read line. See, I'd written nothing and this.

So it printed whole sentence. delta e o f is he owes us is raised Since read and read line have same functionality, but our difference is that it means the given number of bytes. It made it less than if you have is hit and read line. It reads an entire line from the fight. So keep learning keep growing and happy coding

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.