FAQ: Survey of Computer Science - The Tale of Kenny - Control Flow and Logic

Hi everyone, sorry i am new to coding and “Code Foundations” is my ever first coding course.

I would like to find out at this stage, am i suppose to understand how to code is being written?
or do i just play around it , following what the instruction said, "copy and paste `python kenny_the_health_inspector.py`". i manged to start running it in the bash.

(or) the aim of the slides are there just for us to understand the concept of the algorithm?

because at this stage, if the aim is to understand and knowing what each code and symbols mean, then i will have do find out what they are on google or youtube.

Hope someone can help with my questions. thank you all

I don’t believe you’re required to understand the code itself at this point, nor are the lessons set up in a way for you to learn it. It’d be best to just complete this course first and then consider learning an actual programming language with a course designed for that purpose as it’ll be much easier to follow.

I think the main point is that control flow is a useful tool with applications both in the real world and with programming. If you can start thinking in this way you’ll find it a lot easier to create more complex programs in the future. I don’t mean you have to analyse every scenario in life like this but understand that many things can be boiled down in this way allowing a similar logic to be applied to any programming you may do.

does anyone what these code really means? i have no idea what the following really means?
Q1: what is len( )? Does it means length?
Q2: print ("+str(i+1)" … what is str?
Q3: print("("+str(i+1)+") " + locations[i]+"\n") … what is the formula doing here? dont get the logic here . Hope someone can help

for i in range(0,len(locations)):
print("("+str(i+1)+") " + locations[i]+"\n")

You can find details of these functions, `len()` and `str()`, in the Python documentation-

As mentioned above if you wanted to learn Python as a language then look for a course which does that. Code foundations is the wrong spot to be learning the language itself.

bottom of the page you need to “Enter the number of your choice: -1”

Your options as far as bash and python are concerned are actually

(0) Billy’s …

(1) Lucy’s …

(2) Laura’s …

Bump this post - it is the solution people are seeking.

1 Like

This worked for me!!

“ Click run, then copy and paste `python kenny_the_health_inspector.py` into the terminal on the far right titled `bash` and hit return or enter on your keyboard”.