A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 2 years ago

Hey, i'm doing the optional exercises of hw1 of 6.189 ( A gentle Intro to programming with python) OPT.1 Zeller's Algorithm: I'm getting the following error when inputing X Y W Z: " Traceback (most recent call last): File "C:/Python26/MIT Homework/zellers.py", line 10, in <module> W= (13*A-1)/5 TypeError: unsupported operand type(s) for -: 'str' and 'int' "

  • This Question is Closed
  1. michaelseyne
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    There is a problem with the value type I believe. check with : W = (13 * int(A) - 1)/5 the function int() change a string into an integer. Can you show your code if you still have an issue ?

  2. Dodonga
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thank you that was exactly it! i was using raw_input instead of int(input

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...


  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.