Don't be 'that tutor'
How (not) to answer student questions - illustrated by actual tutor responses.
Don’t read the problem description
Student: Hi tutor can you tell me what do I need to make the "bird" word lowercase? or is this end of programming. [code]
🙁Tutor: [explain .lower()]
😀Tutor: You don’t actually need to convert anything to lowercase for this question, so the solution you initially posted looks fine to me.
Don’t take the time to write a coherent response
Student: Hello, what does it mean by failing the 100m off the coast test? Here is my code:
a = raw_input("Enter the distance (in metres): ")
if int(a) <= 100:
print "Too close!"
if int(a) >= 101:
print "Safe."
🙁Tutor: If you give your program the case off 100 it is out putting the opposite of the one the marker is expecting. be careful which operators you choose py@<@ and py@>@ are operators in their own right
Don’t read the student’s question
Student: The question is basically asking me to write a program that reads in two proteins of the same length and returns how many of the amino acid letters are different. e.g
Cheetah protein: IGADKYFHARGNYDAA
Domestic cat protein: KGADKYFHARGNYEAA
2 difference(s).
However....the way I'm planning on approaching it is
1) asking for input (the cheetah / domestic cat protein) and storing in a variable
2) using a for loop to go through every sub-string e.g if input1[0] is not equal to input2[0] it will simply add 1 to the variable that stores the difference
I don't know how to do this using the for loop, if it is even possible :S maybe I'm doing the whole thing wrong?
I still haven't made any progress, any tips?
🙁 Tutor: Hi, Here is my tip for this question. I hope that gives you some ideas
>>> string1="a"
>>> string2="b"
>>> int(string1==string2)
0
>>> int(string1==string1)
1
Suggest convoluted, ugly ways of writing code
See above example!
Don’t look at the sample solution, or ask other tutors if you’re in doubt
Also see above example!
Never try to find the actual problem
Student: I was wondering if you can change Boolean values to numerical data
🙁Tutor: You sure can!
>>> int(True)
1
>>> int(False)
0
Hope that answers your question
Soon…
x=raw_input("Enter some text: ")
x1=x.lower()
x2=x1.startswith("q")
x3=x1.endswith("q")
x4=x.count("q")
c1= x.int(True)
c2= x.int(True)
if c1+c2==x4:
print "Surrounding Q's"
elif c1+c2 !=x4:
print "Internal Q's"
else:
print "Other"