User Profile

Collapse

Profile Sidebar

Collapse
callumagus
callumagus
Last Activity: Mar 14 '08, 01:09 PM
Joined: Mar 13 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • callumagus
    replied to Else error
    The finished product!

    Code:
    import math
    
    while True:
        String_Var = raw_input ('Add, Divide, Multiply, Subtract, Square, Square Root, Index Notation,  or Quit? ').lower()
     
        if 'add' in String_Var:
            try:
                Var1 = float(raw_input ('Number 1: '))
                Var2 = float(raw_input ('Number 2: '))
            except:
                print 'Invalid input, numbers
    ...
    See more | Go to post

    Leave a comment:


  • callumagus
    replied to Else error
    thanks. so, that will return an aerror message unless they enter a number?...
    See more | Go to post

    Leave a comment:


  • callumagus
    replied to Else error
    ok thanks for your help; ive tested the program and it works perfectly now....
    See more | Go to post

    Leave a comment:


  • callumagus
    replied to Else error
    Thank you, the else problem is solved now. What is the command for 'divide'?
    See more | Go to post

    Leave a comment:


  • callumagus
    started a topic Else error

    Else error

    Python Version 2.0
    Windows Vista (I know, I know...)

    Im very new to python and have only been doing it for two weeks.


    print 'Type in lowercase!';
    String_Var = raw_input ('Add, Divide, Multiply or Subtract? ');

    if 'add' in String_Var:
    AddVar1 = raw_input ('Number 1: ');
    AddVar2 = raw_input ('Number 2: ');
    Add_Var = AddVar1 + AddVar2;
    print AddVar1, '+',...
    See more | Go to post
No activity results to display
Show More
Working...