← Back to the Introduction to Computer Science outline The Course Maker
← Introduction to Computer Science outline
Week 2 · Discussion: Traditional alternative (no AI)

Week 2 Discussion — When a Number Is the Wrong Kind of Value — Traditional alternative (no AI)

Introduction to Computer Science Free sample edition
Traditional alternative (no AI), unpublished. In the course this is a separate discussion that ships unpublished beside the adaptive discussion: same objective, no AI. An instructor who prefers it publishes it and unpublishes or deletes the adaptive one, as the note at its top says.

Instructors: publish this instead of the adaptive version if you prefer, and unpublish or delete the adaptive one.

Hook

Python will not add the text "5" to the number 3; it stops with a TypeError instead of guessing. This week you met the rule behind that refusal, and you learned to convert a value on purpose with int(), float(), or str(). That rule raises a real question about who should decide what a program does with a value.

Your discussion question — choose Option A or Option B; they carry the same weight and the same rubric, and you say which you picked.

Option A: Describe a real time a number was handled as the wrong kind of value: a phone number, an ID, a price, a postal code, or a count that a form, an app, or a program treated as text when it should have been a number, or as a number when it should have been text. Say what went wrong, which type it should have been and why, and decide who should catch that kind of slip, the person entering the value or the program receiving it.

Option B: When a program runs print("5" + 3), Python does not guess whether you meant 8 or 53; it stops and names a TypeError on the last line of its error message. Should a programming language refuse to mix text and numbers like that, or should it guess what you meant? Take a position, use this week's ideas (a variable, a data type, type conversion, and a TypeError), and say what someone who values convenience differently from you would argue.

There is no single right answer. People who agree on every fact about what Python prints still disagree about who should catch a slip and how much a language should guess, because those questions rest on judgment as well as on the facts. Pick the option you actually care about, and make your case.

Expectations

Activity format: one initial post followed by two substantive peer replies. Plan on about 45 minutes across the two deadlines; your instructor sets both due dates in Canvas.

Your initial post — by the first due date (early in the module week):

  • Say which option you chose.
  • For Option A, describe the value, say which type it was treated as and which type it should have been, and say who should catch that slip and why; for Option B, say whether a language should refuse or guess, and give a reason or an example.
  • Use at least two of this week's terms (variable, data type, int, float, str, type conversion, TypeError) correctly.
  • State the strongest case for a view you do not hold, in one or two sentences.
  • Length: roughly 150–250 words if written. You may instead record your post as audio or video (about two minutes) and attach a transcript; both forms are scored by the same rubric.

Your replies — by the second due date (the end of the module week):

  • Reply substantively to at least two classmates.
  • A substantive reply does more than agree: point to a value in their example whose type is still unclear, suggest the conversion that would fix it, or make the strongest fair case for the side they did not take. "Nice point!" on its own does not count.

What a strong post looks like:

I chose Option A. A sign-up form at my gym stored my locker code as a number, so a code that started with a zero lost the zero and no longer matched my lock. A locker code is a label, not an amount, so it should have been a str: nobody adds two locker codes together. I think the program should catch this, because it knows what the value is for and the person typing it does not. Someone could argue that the person should check what was saved, and that is fair, but a program can apply one rule to every entry every time.

Notice how it names the exact value, says which type it had and which type it needed, takes a position, and states a fair case for the other side. That is the bar.

Participation rubric

This discussion is worth 10 points. The three criteria below look at your initial post and your peer replies.

How the 10 points of this discussion are earned
Criterion Full credit Partial credit No credit
Quality of the initial post (4 pts) A specific value or program, with the type it had and the type or rule it should have used named, a reason, and a fair statement of another view A value or rule is present, but the type stays vague or the position is asserted without a reason Missing, off-topic, or no reasoning about types
Use of course concepts (3 pts) Uses variable, data type, type conversion, and TypeError precisely, with every term applied correctly Uses a term loosely, or confuses a str with an int No course terms, or used incorrectly
Engagement with peers (3 pts) Two or more substantive replies that extend or challenge a classmate's reasoning One substantive reply, or replies that only agree No replies, or "I agree" with nothing added

Post early if you can — the best threads happen when people have time to reply before the second due date.

Built with The Course Maker · samples.thecoursemaker.com