chevron_left chevron_right

 Some thing fun I made in seconds filter_list Linear Mode Threaded Mode View a Printable Version Author Message
Some thing fun I made in seconds #1
Code:
```multAge = int(input('Multiply the first number of your age by 5 and enter it ' )) addAge = multAge + 3 doubleAge = addAge * 2 Addsecond = int(input('Add the second number of your age ' )) Secondadd = doubleAge + Addsecond age = Secondadd - 6 print(age)```

It's the simplest thing ever, however it's still fun. (the math for this: Ask the person to multiply the first number of his or her age by 5.
Now tell them to double this figure.
Finally, have the person add the second number of his or her age to the figure and ave them tell you their answer.
Deduct 6 and you will have their age.)

Ps. I know the math involved is sorta childish, but yeah I was bored... RE: Some thing fun I made in seconds #2
Code:
```input("Think about a number and press enter...") input("Multiply the number by 9...") input("Deduct 5 from the result...") input("Now sum the digits composing the result...") input("If there are still more than 2 digits sum them until you have a one digit number...") print("... which is 4.")```

RE: Some thing fun I made in seconds #3
Code:
```input("Think about a number and press enter...") input("Multiply the number by 9...") input("Deduct 5 from the result...") input("Now sum the digits composing the result...") input("If there are still more than 2 digits sum them until you have a one digit number...") print("... which is 4.")```

RE: Some thing fun I made in seconds #4
It's cool. You should check the input though. Otherwise you could have just done this:
Code:
```num1 = (int(input('Multiply the first number of your age by 5 and enter it ' )) + 3) * 2 num2 = int(input('Add the second number of your age ' )) age = num1 + num2 - 6 print(age)```
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

RE: Some thing fun I made in seconds #5
It's cool. You should check the input though. Otherwise you could have just done this:
Code:
```num1 = (int(input('Multiply the first number of your age by 5 and enter it ' )) + 3) * 2 num2 = int(input('Add the second number of your age ' )) age = num1 + num2 - 6 print(age)```
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

RE: Some thing fun I made in seconds #6
Input is already an number so 14 = int 14.00 = float
you're right about it if you are counting it towards even if the user fills out .00 or if it was raw_input = most likely a string

RE: Some thing fun I made in seconds #7
(09-19-2013, 11:06 PM)hellomen Wrote: Input is already an number so 14 = int 14.00 = float
you're right about it if you are counting it towards even if the user fills out .00 or if it was raw_input = most likely a string

Nope, he is using Python 3 (most likely). And there input() returns a string.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans. RE: Some thing fun I made in seconds #8
(09-20-2013, 07:26 AM)Deque Wrote:
(09-19-2013, 11:06 PM)hellomen Wrote: Input is already an number so 14 = int 14.00 = float
you're right about it if you are counting it towards even if the user fills out .00 or if it was raw_input = most likely a string

Nope, he is using Python 3 (most likely). And there input() returns a string.

Sorry mate I thought it was python 2 my bad I am new in python and I just learned that

Users browsing this thread: 1 Guest(s)