The more information/context you provide, the better we (the instructors and class) can collectively assist you.
Please fill out all of the relevant sections below. Incomplete questions will not be addressed by the instruction team.
Questions asked without showing an attempt to answer individually will also not be addressed.
It is bad etiquette to ask things such as "I don't know how to do this, can you tell me how?" or "I can't get this code to work, what is wrong?" if you do not provide the context and/or screenshots necessary to
help.
Question (continued)
This is an example coding question that will demonstrate how to use this question temple. The example here is how to parse a comma separated file.
What do you have?
I have a text file named foo.csv. That means my input is a str that references the path to a text file. Additionally, the values in foo.csv are separated by a ,. This means that my delimiter is a str as well.
The content of this file are:
1,2,3
a,b,c
What do you need?
I expect that this code should be able to open up the file and process it line-by-line and give me the values as a list
What have you done?
If this is a coding question
Every time I open the program, it only gives me the last line of the file instead of each of the lines
User-written code
file = open('foo.bar')
for line in file:
parsed)_line = line.split(',')
print(line)
Observed error messages
# Paste the observed error messages here
Observed output of code (other than error messages)
# Paste the output of your coding attempts here
[ 'a', 'b', 'c']
Checklist
Replace the space in between the brackets with an X
[X] Identified what you already have available to address this question
[X] Identified what you need to reach an acceptable answer
[X] Shown what you have done up to this point
[ ] A hypothesis if this is a general question
[X] Your code, error messages, and output if this is a coding question
Instructions
The more information/context you provide, the better we (the instructors and class) can collectively assist you.
Please fill out all of the relevant sections below. Incomplete questions will not be addressed by the instruction team.
Questions asked without showing an attempt to answer individually will also not be addressed.
It is bad etiquette to ask things such as "I don't know how to do this, can you tell me how?" or "I can't get this code to work, what is wrong?" if you do not provide the context and/or screenshots necessary to help.
Question (continued)
This is an example coding question that will demonstrate how to use this question temple. The example here is how to parse a comma separated file.
What do you have?
I have a text file named
foo.csv
. That means my input is astr
that references the path to a text file. Additionally, the values infoo.csv
are separated by a,
. This means that my delimiter is astr
as well.The content of this file are:
What do you need?
I expect that this code should be able to open up the file and process it line-by-line and give me the values as a
list
What have you done?
If this is a coding question
Every time I open the program, it only gives me the last line of the file instead of each of the lines
User-written code
Observed error messages
Observed output of code (other than error messages)
Checklist
Replace the space in between the brackets with an X