Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Dodonga

  • one year 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
    • one year 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
    • one year 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

Ask a Question
Find more explanations on OpenStudy

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...

23

  • 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.