This post is an example of how not to ask a question.

This is the place for queries that don't fit in any of the other categories.

This post is an example of how not to ask a question.

Postby murster972 » Thu Aug 01, 2013 8:35 pm

a
Last edited by murster972 on Mon Aug 12, 2013 4:35 pm, edited 2 times in total.
murster972
 
Posts: 20
Joined: Fri Jul 19, 2013 8:54 pm

Re: please help.

Postby metulburr » Thu Aug 01, 2013 10:13 pm

it wont work

your gonna have to be more specific than that

Just from quickly looking at it:\
Code: Select all
def calc_main():
   print"Muzza's Calculator v1"
   print"1 - Addition"
   print"2 - Subtraction"
   
   choice = raw_input("Option: ")
   
   if choice == 1:
      x = raw_input("First Number: ")
      y = raw_input("Second Number: ")
      if x > 0 and y > 0:
         answer = x + y
         print answer
   calc_main()         
   
   elif choice == 2:
      x = raw_input("First Number: ")
      y = raw_input("Second Number: ")
      if x > 0 and y > 0:
         answer = x - y
         print answer
   calc_main() 

this code doesnt make any sense. the if condition and its corresponding elif is split up by a recursion call.

indentation is python code blocks
New Users, Read This
version Python 3.3.2 and 2.7.5, tkinter 8.5, pyqt 4.8.4, pygame 1.9.2 pre
OS Ubuntu 13.04, Mint 11, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
User avatar
metulburr
 
Posts: 1094
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 2 guests