SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
2 Points Suppose that the file out.txt is 48 lines long. If we executed the lines of code below
from a Python file in the same folder as out.txt, how many lines long would out.txt be after the
program finished executing? 1 2 48 49 A Runtime Error would occur
Q4 CSV files 3 Points file = open ('info.csv', ' r ' ) data = file, readiines () file, close( ) total = 0
for row in datat row = row.strip() entries = row. Bplit (,) for val in entries: Suppose that info.csv
is a CSV (comma-separated values) file, where the rows and columns of the CSV file represent
the rows and columns of a matrix of integers (there's no header row/column). Fill in the blank in
the program above with a single line of code, such that by the end of the program, the variable
total represents the sum of all the integers in the CSV file.

Más contenido relacionado

Similar a 2 Points Suppose that the file out.txt is 48 lines long. If we execut.pdf

Type header file in c++ and its function
Type header file in c++ and its functionType header file in c++ and its function
Type header file in c++ and its function
Frankie Jones
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
Dushmanta Nath
 
Python help- You will be writing an encryption program for an IT compa.pdf
Python help- You will be writing an encryption program for an IT compa.pdfPython help- You will be writing an encryption program for an IT compa.pdf
Python help- You will be writing an encryption program for an IT compa.pdf
ChristopherkUzHunter
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input Output
Bharat17485
 
The actual illustration of values is decided by the machine design (.pdf
The actual illustration of values is decided by the machine design (.pdfThe actual illustration of values is decided by the machine design (.pdf
The actual illustration of values is decided by the machine design (.pdf
anyacarpets
 
Please write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdfPlease write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdf
fazilfootsteps
 
import java.io.BufferedReader;import java.io.BufferedWriter;.docx
import java.io.BufferedReader;import java.io.BufferedWriter;.docximport java.io.BufferedReader;import java.io.BufferedWriter;.docx
import java.io.BufferedReader;import java.io.BufferedWriter;.docx
wilcockiris
 
Wireshark Lab TCP v6.0 Supplement to Computer Networking.docx
Wireshark Lab TCP v6.0  Supplement to Computer Networking.docxWireshark Lab TCP v6.0  Supplement to Computer Networking.docx
Wireshark Lab TCP v6.0 Supplement to Computer Networking.docx
alanfhall8953
 
Chapter 10 Library Function
Chapter 10 Library FunctionChapter 10 Library Function
Chapter 10 Library Function
Deepak Singh
 

Similar a 2 Points Suppose that the file out.txt is 48 lines long. If we execut.pdf (20)

Acm aleppo cpc training ninth session
Acm aleppo cpc training ninth sessionAcm aleppo cpc training ninth session
Acm aleppo cpc training ninth session
 
Type header file in c++ and its function
Type header file in c++ and its functionType header file in c++ and its function
Type header file in c++ and its function
 
It’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdfIt’s sometimes useful to make a little language for a simple problem.pdf
It’s sometimes useful to make a little language for a simple problem.pdf
 
Day2
Day2Day2
Day2
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
Python help- You will be writing an encryption program for an IT compa.pdf
Python help- You will be writing an encryption program for an IT compa.pdfPython help- You will be writing an encryption program for an IT compa.pdf
Python help- You will be writing an encryption program for an IT compa.pdf
 
Stream Based Input Output
Stream Based Input OutputStream Based Input Output
Stream Based Input Output
 
The actual illustration of values is decided by the machine design (.pdf
The actual illustration of values is decided by the machine design (.pdfThe actual illustration of values is decided by the machine design (.pdf
The actual illustration of values is decided by the machine design (.pdf
 
CPP homework help
CPP homework helpCPP homework help
CPP homework help
 
ENGLISH PYTHON.ppt
ENGLISH PYTHON.pptENGLISH PYTHON.ppt
ENGLISH PYTHON.ppt
 
Please write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdfPlease write a code in JAVA to do line editor..Your program will b.pdf
Please write a code in JAVA to do line editor..Your program will b.pdf
 
manish python.pptx
manish python.pptxmanish python.pptx
manish python.pptx
 
import java.io.BufferedReader;import java.io.BufferedWriter;.docx
import java.io.BufferedReader;import java.io.BufferedWriter;.docximport java.io.BufferedReader;import java.io.BufferedWriter;.docx
import java.io.BufferedReader;import java.io.BufferedWriter;.docx
 
Python Scipy Numpy
Python Scipy NumpyPython Scipy Numpy
Python Scipy Numpy
 
Systematic error codes implimentation for matched data encoded 47405
Systematic error codes implimentation for matched data encoded 47405Systematic error codes implimentation for matched data encoded 47405
Systematic error codes implimentation for matched data encoded 47405
 
Wireshark Lab TCP v6.0 Supplement to Computer Networking.docx
Wireshark Lab TCP v6.0  Supplement to Computer Networking.docxWireshark Lab TCP v6.0  Supplement to Computer Networking.docx
Wireshark Lab TCP v6.0 Supplement to Computer Networking.docx
 
Chapter 10 Library Function
Chapter 10 Library FunctionChapter 10 Library Function
Chapter 10 Library Function
 
Basic explanation to md5 implementation in C
Basic explanation to md5 implementation in CBasic explanation to md5 implementation in C
Basic explanation to md5 implementation in C
 
Memory layout in C++ vis a-vis polymorphism and padding bits
Memory layout in C++ vis a-vis polymorphism and padding bitsMemory layout in C++ vis a-vis polymorphism and padding bits
Memory layout in C++ vis a-vis polymorphism and padding bits
 
Kavitha_python.ppt
Kavitha_python.pptKavitha_python.ppt
Kavitha_python.ppt
 

Más de allystr

Más de allystr (20)

2. (20 marks) Use ID3 to learn a decision tree for the foll.pdf
 2. (20 marks) Use ID3 to learn a decision tree for the foll.pdf 2. (20 marks) Use ID3 to learn a decision tree for the foll.pdf
2. (20 marks) Use ID3 to learn a decision tree for the foll.pdf
 
2. (10) Given IP address 192.168.1.024, Assume each LAN should host.pdf
 2. (10) Given IP address 192.168.1.024, Assume each LAN should host.pdf 2. (10) Given IP address 192.168.1.024, Assume each LAN should host.pdf
2. (10) Given IP address 192.168.1.024, Assume each LAN should host.pdf
 
2. (10 points) Over the last decade researchers have been working act.pdf
 2. (10 points) Over the last decade researchers have been working act.pdf 2. (10 points) Over the last decade researchers have been working act.pdf
2. (10 points) Over the last decade researchers have been working act.pdf
 
2. (10 points) Let XP, and let ^ denote the MLE of . Suppose that h i.pdf
 2. (10 points) Let XP, and let ^ denote the MLE of . Suppose that h i.pdf 2. (10 points) Let XP, and let ^ denote the MLE of . Suppose that h i.pdf
2. (10 points) Let XP, and let ^ denote the MLE of . Suppose that h i.pdf
 
2. (10 points) Suppose X1,�,Xn are i.i.d. N(,2) with =0 known. Show t.pdf
 2. (10 points) Suppose X1,�,Xn are i.i.d. N(,2) with =0 known. Show t.pdf 2. (10 points) Suppose X1,�,Xn are i.i.d. N(,2) with =0 known. Show t.pdf
2. (10 points) Suppose X1,�,Xn are i.i.d. N(,2) with =0 known. Show t.pdf
 
2- In a random sample of 200 people, 154 said that they watched educa.pdf
 2- In a random sample of 200 people, 154 said that they watched educa.pdf 2- In a random sample of 200 people, 154 said that they watched educa.pdf
2- In a random sample of 200 people, 154 said that they watched educa.pdf
 
2- Solve the linear system y=[1141]y.pdf
 2- Solve the linear system y=[1141]y.pdf 2- Solve the linear system y=[1141]y.pdf
2- Solve the linear system y=[1141]y.pdf
 
2- The author didnt finish his biography on the agreed date in the c.pdf
 2- The author didnt finish his biography on the agreed date in the c.pdf 2- The author didnt finish his biography on the agreed date in the c.pdf
2- The author didnt finish his biography on the agreed date in the c.pdf
 
2) Use the Table (below) to answer the questions that follow. It cont.pdf
 2) Use the Table (below) to answer the questions that follow. It cont.pdf 2) Use the Table (below) to answer the questions that follow. It cont.pdf
2) Use the Table (below) to answer the questions that follow. It cont.pdf
 
2) Let X1,X2,�Xn are i.i.d random sample from P() a) Find the Suffici.pdf
 2) Let X1,X2,�Xn are i.i.d random sample from P() a) Find the Suffici.pdf 2) Let X1,X2,�Xn are i.i.d random sample from P() a) Find the Suffici.pdf
2) Let X1,X2,�Xn are i.i.d random sample from P() a) Find the Suffici.pdf
 
2) Of those mountain climbers who attempt to climb Mt. McKinley, only.pdf
 2) Of those mountain climbers who attempt to climb Mt. McKinley, only.pdf 2) Of those mountain climbers who attempt to climb Mt. McKinley, only.pdf
2) Of those mountain climbers who attempt to climb Mt. McKinley, only.pdf
 
2) [50 points ] Families have to make decisions about child care. Opt.pdf
 2) [50 points ] Families have to make decisions about child care. Opt.pdf 2) [50 points ] Families have to make decisions about child care. Opt.pdf
2) [50 points ] Families have to make decisions about child care. Opt.pdf
 
2) Let ci be the average cost for firm i (so that firms may have diff.pdf
 2) Let ci be the average cost for firm i (so that firms may have diff.pdf 2) Let ci be the average cost for firm i (so that firms may have diff.pdf
2) Let ci be the average cost for firm i (so that firms may have diff.pdf
 
2) Consider the following subnet. Distance vector routing is used, an.pdf
 2) Consider the following subnet. Distance vector routing is used, an.pdf 2) Consider the following subnet. Distance vector routing is used, an.pdf
2) Consider the following subnet. Distance vector routing is used, an.pdf
 
2) Consider the joint probability density f(x,y)={xy0�for�1x73�and.pdf
 2) Consider the joint probability density f(x,y)={xy0�for�1x73�and.pdf 2) Consider the joint probability density f(x,y)={xy0�for�1x73�and.pdf
2) Consider the joint probability density f(x,y)={xy0�for�1x73�and.pdf
 
2 Problem 1. Recursion-Video rankings. ( 8 marks) The InitaVid social.pdf
 2 Problem 1. Recursion-Video rankings. ( 8 marks) The InitaVid social.pdf 2 Problem 1. Recursion-Video rankings. ( 8 marks) The InitaVid social.pdf
2 Problem 1. Recursion-Video rankings. ( 8 marks) The InitaVid social.pdf
 
2 Let X and Y be two independent random variables with the property t.pdf
 2 Let X and Y be two independent random variables with the property t.pdf 2 Let X and Y be two independent random variables with the property t.pdf
2 Let X and Y be two independent random variables with the property t.pdf
 
2 Parameter Stability Test (Chow Test) Considering 1940 a period w.pdf
 2 Parameter Stability Test (Chow Test) Considering 1940 a period w.pdf 2 Parameter Stability Test (Chow Test) Considering 1940 a period w.pdf
2 Parameter Stability Test (Chow Test) Considering 1940 a period w.pdf
 
2 Let X and Y be two independent random variables with the proper.pdf
 2 Let X and Y be two independent random variables with the proper.pdf 2 Let X and Y be two independent random variables with the proper.pdf
2 Let X and Y be two independent random variables with the proper.pdf
 
19. Blood type is controlled by a gene with multiple alleles. A pro.pdf
 19. Blood type is controlled by a gene with multiple alleles. A pro.pdf 19. Blood type is controlled by a gene with multiple alleles. A pro.pdf
19. Blood type is controlled by a gene with multiple alleles. A pro.pdf
 

Último

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Último (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 

2 Points Suppose that the file out.txt is 48 lines long. If we execut.pdf

  • 1. 2 Points Suppose that the file out.txt is 48 lines long. If we executed the lines of code below from a Python file in the same folder as out.txt, how many lines long would out.txt be after the program finished executing? 1 2 48 49 A Runtime Error would occur Q4 CSV files 3 Points file = open ('info.csv', ' r ' ) data = file, readiines () file, close( ) total = 0 for row in datat row = row.strip() entries = row. Bplit (,) for val in entries: Suppose that info.csv is a CSV (comma-separated values) file, where the rows and columns of the CSV file represent the rows and columns of a matrix of integers (there's no header row/column). Fill in the blank in the program above with a single line of code, such that by the end of the program, the variable total represents the sum of all the integers in the CSV file.