chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Some thing fun I made in seconds filter_list
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. Biggrin


(the math for this: Ask the person to multiply the first number of his or her age by 5.
Tell them to add 3.
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...
[Image: HJIAwEw.png]

Reply

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.")
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U

If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

Reply

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.")
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U

If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

Reply

RE: Some thing fun I made in seconds #4
It's cool. Smile 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 ]

Reply

RE: Some thing fun I made in seconds #5
It's cool. Smile 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 ]

Reply

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
Calling me stupid won't mind me it only shows your immaturity -<3

[Image: 120x240.gif]

Reply

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.

[Image: 2YpkRjy.png]

Reply

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
Calling me stupid won't mind me it only shows your immaturity -<3

[Image: 120x240.gif]

Reply






Users browsing this thread: 1 Guest(s)