CS101 (Python/Java)

College Intro · Computer Science

CS101 is the first programming course most computer science and engineering majors take, usually in Python, Java, or both. The work is learning to translate a problem statement into working code: declaring variables, controlling flow with conditionals and loops, breaking programs into functions or methods, and using an object's fields and behaviour. Sessions are spoken, so you describe what your program should do and what it actually does, and you trace execution line by line out loud rather than pasting in a file and waiting for a fix. Typical starting points are a failing lab, a stack trace you can't read, or an assignment spec you don't know how to begin.

Start a session on CS101 (Python/Java)

What this covers

  • Variables, primitive types and static vs. dynamic typing: why Java needs int count = 0; and Python does not, integer vs. float division, string-to-number conversion, and where implicit casting silently loses precision
  • Control flow: if/elif/else and switch, while vs. for loops, loop counters and accumulators, nested loops, and using break and continue without producing unreachable code
  • Functions and methods: parameters vs. arguments, return values vs. printing, local scope and shadowing, default and keyword arguments in Python, method signatures and overloading in Java
  • Basic collections as a language feature: Python lists, dictionaries and slicing; Java arrays and ArrayList; indexing from zero, iterating with enhanced for loops, and avoiding off-by-one errors
  • Intro object-oriented programming: writing a class, constructors, instance fields, this/self, public vs. private, toString/__str__, and creating and comparing multiple objects
  • Debugging and error reading: interpreting a Java stack trace or Python traceback, distinguishing syntax errors from runtime exceptions from logic errors, and inserting print statements or a debugger to find where state goes wrong
  • File and console I/O: reading input with Scanner or input(), parsing lines, opening and closing files, and handling exceptions with try/except or try/catch

Where learners get stuck

Believing a variable holds an expression rather than a value, so students expect total to update automatically after the variables inside it change
Algebra trains students to read x = y + z as a permanent relationship. In code it is a one-time assignment, and nothing recomputes unless the line runs again.
Confusing printing with returning, so a function prints the right answer but callers receive None or nothing usable
Early exercises grade on console output, so print feels like the function 'worked'. The distinction only bites when one function has to consume another's result.
Assuming = compares and == checks object identity, especially comparing Java Strings with == or expecting two lists with the same contents to be interchangeable
Mathematical notation uses one equals sign for both roles, and in Java == happens to work for small ints and cached strings, so the wrong mental model passes tests until it suddenly doesn't.
Treating passing an object or list to a function as making a copy, then being surprised when the caller's data changed
Textbook diagrams show variables as boxes holding values, which is accurate for primitives but hides the reference for objects, arrays and lists.

What a session looks like

A session usually starts with the specific code or concept in front of you. You read out the relevant lines or describe the structure, and Evelyn asks what you expect each line to do before running it, so mismatches between your mental model and the machine's behaviour surface quickly. For a bug, the approach is tracing variable values through the loop or call rather than being told the fix. For a new concept such as constructors or scope, you get a small worked example, then write the next one yourself and explain it back. Questions are pitched to make you predict output first and check second.

Helpful to know first

  • Comfort with high school algebra: variables, functions as input-to-output mappings, and evaluating expressions with order of operations
  • Ability to install and run a Python interpreter or a Java JDK and IDE, or access to a course environment like Replit, IDLE or Eclipse
  • No prior programming experience required; students arriving from a first-week lecture on printing 'Hello, World' are at the right point

Questions

Should I learn Python or Java first for CS101?
Follow whatever your course uses, since the assignment autograders assume that language's syntax. Sessions can cover either, and can also help you map concepts across if your program teaches Python in semester one and switches to Java in semester two.
Can it help with my graded programming assignment?
It can explain the concepts your assignment tests, trace your logic, and help you interpret error messages, in the same way a study partner would. It will not write the submission for you, and you should check your institution's academic integrity policy on AI assistance before using any tool for graded work.
I understand the lecture but freeze when I face a blank file. Does this help?
That gap is the usual reason people struggle in CS101. Sessions work on decomposition: restating the spec, identifying inputs and outputs, sketching the steps in plain language, and turning each step into a function before worrying about syntax.
How is this different from a Data Structures or Algorithms session?
CS101 sessions stay on language mechanics and program construction: types, loops, functions, classes, and debugging. Analysing why one approach is faster, or implementing linked lists and trees, belongs to the Data Structures and Algorithms topics.
My code runs but gives the wrong answer. Can voice tutoring find that?
Yes, and it is often faster out loud. You state the input, what you expected, and what you got, then walk through the loop one iteration at a time saying each variable's value. Logic errors nearly always appear at the iteration where your spoken prediction stops matching the output.

Other College Intro Computer Science topics