Code Point
September 08, 2010, 09:06:25 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Geshi Sintax Hilighting Mod Installed. Tens of languages available.
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: help!  (Read 2636 times)
bojak71730
Jr. Member
*

Karma: 0
Offline Offline

Posts: 10


« on: February 07, 2007, 12:10:18 AM »

Code:
# age-O-meter

age1 = raw_input("how old are you?")
age2 = raw_input("how old is your friend?")
age1 - age2
calculate = age1, - age2

ok lets says u set how old are you to 30 and how old is your friend to 50 the result should be 20 put its not working and idk what i did wrong
Logged
bojak71730
Jr. Member
*

Karma: 0
Offline Offline

Posts: 10


« Reply #1 on: February 07, 2007, 12:16:53 AM »

i know that i need to put int some where i just dont know how to do it
Logged
bojak71730
Jr. Member
*

Karma: 0
Offline Offline

Posts: 10


« Reply #2 on: February 07, 2007, 12:27:03 AM »

ok i figured out my problem anyone know how not to make it a negative number?
Logged
bojak71730
Jr. Member
*

Karma: 0
Offline Offline

Posts: 10


« Reply #3 on: February 07, 2007, 12:29:42 AM »

nvm dont need help with that either its common sense i should put it so the friend question gets asked first then your age should get asked second
Logged
jsheedy
Jr. Member
*

Karma: 1
Offline Offline

Posts: 7



WWW
« Reply #4 on: March 09, 2007, 05:13:48 AM »

Code:
# age-O-meter

age1 = raw_input("how old are you?")
age2 = raw_input("how old is your friend?")
age1 - age2
calculate = age1, - age2

ok lets says u set how old are you to 30 and how old is your friend to 50 the result should be 20 put its not working and idk what i did wrong

I suppose you could also use an if statement, say...

if age1 >= age2:
  calculate = age1 - age2
else:
  calculate = age2 - age1

Seems like it would work to me, but i am just learning.
Logged

jsheedy
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!