Added: 2 years ago
From: thenewboston
Views: 217,391
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (504)

Sign In or Sign Up now to post a comment!
  • -5 * -5 * -5 * -5 = - 625

  • "on Gooeey"

  • i'm using 3.2.2 - when i do something like 18/5 it doesn't truncate the quotient...it gives me 3.6

    i downloaded 2.7.2 to see if it was an ID10T error on my end and it truncated in that version's (2.7.2) IDLE.

    So, it seems that 3.2.2 has made it so any integer division automatically results with a decimal answer if necessary.

  • Comment removed

  • I typed 5423423432424**423432432432432­4324234 (Enter)

    Python crashed...

  • thank's man

  • WOOOO 1000th like xD

  • Comment removed

  • Thanks man!

  • 17 people thought Python programming tutorial, was to program a snake!

  • @Imrsk007 lol

  • @Imrsk007 what about a virtual snake? ----- asshole dont ruin my dreams!

  • if you want the exponent of a negative number surround it in parentheses; (-5)**4

  • 6 * 6 * 6 = ??

    haha lol

  • i have a calculator i want to be able to program

  • badass!

  • thx!!

  • alright

  • (-5)**5 to get 625. ** takes precedence if -5**5 or -625. -5 to the fifth power is 625.

  • For those of you like me who want to learn how to program, watch all of his tutorials. They seem boring and useless at first but wait till you get to his wxpython tutorials. That's when it gets interesting and you'll seen and understand the potential of learning this language or any other.

  • today i learned that even python can't divide by 0.

  • I like Python. It's so clean and flexible.

  • "time tive time tive" i loled

  • 1.000/3.0000=0.3333333333

    

  • Python 3.x gives you a floating answer by default, you do not need to put a decimal in the math...

  • Comment removed

  • non-python < python

  • His name is Fackie? xD

  • good)

  • Thank You :)

  • @m5h2m6 that is the process python and all calculators do, but the correct process of -5**4 when written should give a positive answer in the laws of maths. to make it work on pyhton and all calculators you need to write (-5)**4 which gives 625 which is correct for 5^4.

  • @MrHappyh1ppo lol, was just about to write something similar when I saw your post. It seems that the Python order of prescedence doesn't consider -5 to be seperate from an operation like 4-5 for example. I tried it on Gnome-calculator as well and that returns the (mathematically incorrect) result of -625. D'oh! I think though my trusty-old Casio used to have a button for specifying a negative number, and hence would get the result correct.

  • @MrHappyh1ppo In advance I apologise for bringing this up 3 months after your post, but you are wrong. Mathematical laws follow the BIDMAS rule, which specifies the order of symbols. Brackets (first), Indices, Division/Multiplication,Additi­on and Subtraction (last).

    Because of this, in -5**4 we read the index (singular of indices) first so that we get this: (-)(5**4). Which is in turn -625.

    Python is not wrong. Neither are calculators. Computer-scientists know what they're doing.

  • @amazoneon Unfortunately it is you who is wrong. Think about it, what is the answer to -5**2? Obviously that is +25. It follows the basic negative*negative equals positive. Calculators and python ect 'read' it as you have said but that is not correct in maths. Have you done maths as a subject at any sort of level? As it appears you haven't, this is basic.

  • @MrHappyh1ppo I'm sorry, Mathematics is my major for uni, calculators and all programming languages are NOT wrong. Double negative only applies when you have a negative multiplied by a negative. But here you have the positive number 5, to the power of 4. So it is 5x5x5x5 and then there is a negative out the front.

    Here's an example.

    8^2 = 64 [8 to the power of 2]

    but -8^2 = -64 [because it is -(8x8)] = -64

    (-8)^2 = 64 [because it is a negative number enclosed in brackets]

  • @amazoneon Totally true bro!

  • @TheBluesftw Cheers for backing me up mate, I'm sick or seeing kids who don't understand fundamental mathematical laws

  • @MrHappyh1ppo So you are tellin -5**4 is positive? Are you nuts mate? When you write -5**4 then the "powering" is not referred to a minus, only to number, and minus is just rewritten, so "by the laws of maths" it should be negative. And when you write (-5)**4 you think of -5 like one number ( which it is ) and powering it whole, and then you are getting positive answer. So python and calculators are totally correct my friend. Its something i learned in sixth grade of elementary. :O

  • OMG...Life Saviour......I worship you man!!!!!!

  • 4:29 6*6*6?

    666?

    DUN-DUN-DUUUUUUUUUUUUUUUUUN.

  • sexy calculator

  • this is not up to date apparently - there is integer division and division using //. If you 18/7 in idle now you will get 2.5714285714285716. 18//7 will result in 4 now. Need an updated tutorial brother.

  • @Pow3rGaming Use python 2.7. There is nothing wrong with the tut. It's better than any other tut you'll find here. Go home.

  • @Pow3rGaming 18.0/7

  • this is the best and easiest pyhton tut everrrr

  • Some people wrote that Python has a bug with this power thing and that is NOT the case. There is an order of operators being executed

    1) " ** "

    2)" * " and " / "

    3) " + " and " - "

  • bam..xD!

  • Shit I started programming a while ago with C++ and now when I look at python I'm like WTF !?

  • @Kamilk12l try lolcode mate.

  • @fullbinky lol it actually looks interesting :)

  • @Kamilk12l haha <3

  • On Python 3.2 Dose not work this way. It will divide normally

  • 5 times 5 time tive time tive

  • dropped python for a while. Running through these again to refresh myself.

  • -5**4 != (-5)**4

  • Oh yyeah.. I'm on windows XP and i cant find that GUI.. It says no new programs.. windows vista ruined everything..

  • whambamthankyamam

  • Wow you sound like my best buddy from when I was a child the way you slurr your words sometimes. Thanks for the great tutorials man! lol.

  • 4:44

    funny guy

  • This is easier then c language , the out put will come immediately

  • @Renuan77 how?

  • @Renuan77 LOL. I noticed that too

    "6*7 and the answer is 42"

  • Math homework = bai bai ... jk

  • I have read sme comments and There mostely math lol I know a bit of C++ and Visual basic 2010 AND THIS is very simple

  • -5*-5*-5*-5 = 625 in python but the same thing just written differently -5**4 = -625 python for some reason has a bug or it contradicts itself

  • @3213528 Not quite: -5**4 would be read the same way as -(5**4). This is not the same thing as (-5)**4 which is -5*-5*-5*-5=625. There is no contradiction, only order of operations.

  • (-5)**4

  • wham bam thank uu ma'm

  • this guys awesome!!!!!!!! im learning java and python from him!!!

  • haha on the newest Python you dont need to put the float in :D

  • EVEN PYTHON CANNOT DIVIDE BY 0! :/

  • @randomguyalwayshere Is that so weird?

  • @randomguyalwayshere

    yeah, it's sucks

  • lol before he said that you had to put a decimal point i already figured it out lol

  • wham, bam, thank you man

  • @NaMeLeSssFaCeLeSss he said, wham, bam, TAKE your man

  • @NaMeLeSssFaCeLeSss I thought it was thank you ma'am unless your gay

  • its amazing how we love 50k views when we get a little harder.... wait until lesson 40

  • I froze python trying 100**100000000

  • @TheMageReborn ajajajajajajajaja

  • I like the way every Transcribe Audio (in the CC box, bottom right) is wrong, except for 'Bam, Bam Wham thank your ma'am!'

  • If u have 3.0 version or higher it doesnt appear 2 but 2.5714285714285716

  • @Otuama3D 14 hours later and it was still calculating. Don't be a dope and try it

  • Comment removed

  • In order to be an adequate programmer, how strong should my maths be? Because mine is not very good at all. That's what's put me off from learning Python in the past.

  • you are the man.. bam!

  • To obtain a correct result for a negative exp, try using parentheses like this:

    (-5)**4

    That'll do it ;)

  • the 3.2 version gives the decimal answer but the program has an error by multiplying numbers, if you do -5**4 = -625 but if you do -5*-5*-5*-5 which is the same it puts 625, the program is aplying the signs law to the exponents like if it were only 2 numbers, if you do -5*5 = -25 if you do -5*-5 = 25 but the program is only taking the sign of the -5 and the exponet 4 and is doing -*+ = -

  • i wonder what kind of application you will be able to create with this python

  • it gave me the decimal answer. please reply to this to help me!

  • Thanks man! This is great! :)

  • or 99999999! XD

  • wham bam thank you mam! haha lol

  • have you seen an error?

    you have to write (-5)**4 maybe?

  • i typed -5**52655 and the program is not responding! hahaha, i broke the compiler

  • lol math

  • Ok i am trying to make a bot on chatango but I dont how to help o-o

    Oh an I have 2.7.1

  • @KingInferno23

    I can teach you ^^ 1001programs(dot)webs(dot)com there is a base part of a chatango bot there which i made, its in python 3.2 (though thats not a big problem) hope it helped

  • Ok i am trying to make a bot on chatango but I dont how to help o-o

  • 15 dislikes are math wizards..

  • @moshe789 -5**4 = -625

    (-5)**4 = 625

  • I love your tutorials.I love you.I love programming :)

  • got a problem, i tried to do -5^4 (-5**4) but it gave me -625; it should be positive, right ? -5 *-5 = 25 *-5 = -125 *-5 = 625 ? somebody got an awnser to this ?

  • @heyaanimerocksheya type in (-5)**4, it should be positive now

  • @heyaanimerocksheya Yes, please use brackets.

  • @acaoer yes; that was actually a very basic maths fault ^^* sorry!

  • I've never seen the ** syntax for exponent before. is this true for any other language

  • what happens if the answer is pi?

  • mine just comes out 2.5714... without 18.0/7, lol just lucky?

  • @tuntuni1000 NOT RESPONDING D:!

  • Anyone else pause at 1:40 and automatically type 18.0/7.0? Just know that you are smarter than everyone else.

  • Loved this! :p

  • Wham bam thank you man lol

  • A perfect way to do my math homework! xD

  • 1. For Python 3.0 compatibility, use // for integer division, rather than /.

    // for integer division also works with recent versions of Python 2, so get in the habit of using it for all your Python programs.

    2. Bucky, in that last example you've got a little operator precedence problem. You didn't take the 4th power of -5, you negated the 4th power of +5:

    >>> -5**4

    -625

    >>> (-5)**4

    625

    >>> -(5**4)

    -625

  • Comment removed

  • @tuntuni1000 my python crash when i did that 0_o

  • @whynotguitar same here lolz xd

  • >>> import math

    >>> math.factorial(20000)

    Wait...

  • -5*-5*-5-*5=-625????

    are you sure?

  • @moshe789 Yeah I was wondering about that too. Turns out it's -(5**4), while you and I were thinking (-5)**4

  • @moshe789 Use brackets

    

  • @moshe789 -5*-5=25, 5*5=25, 25*25=625, whenever you multiply two negative numbers it equals a positive.

  • @moshe789 lol... ^^

  • @moshe789 its -(5*5*5*5). I suppose what you did was (-5)**4.

  • @moshe789 (-5)**4 is not equal to -5**4

  • @moshe789 Have you ever visited a school?

  • @unberobbseful No... I'm from Israel, we don't know school here, we came with the knowledge.

  • @moshe789 come again?

  • @moshe789 you must have a parentese around the negative five or it will read 5^4 and then negative

  • @moshe789

    it is true

    (-5)**4=625

  • @moshe789 since the -5 is not in () it assumes it is (5^4)*(-1)

  • @moshe789 hahahaha right

  • @moshe789 YES

    

  • @moshe789 the "-" must have came as an action after the funtion "5**4" it looks very strangely !

  • @moshe789 In that notation, it's automatically assumed the Negative sign and the Number are disconnected, so therefore it does the operation that looks like: -(5)^4. Just like in math, "-5^4=625" but "- 5^4=-625"

  • @moshe789 It's -(5)^4, not (-5)^4

  • @789prala right!

  • @789prala WRONG (-5)**4 its the right one

  • @moshe789 should be (-5)**4 = 625

  • @moshe789 the exponent only works on the integer if there r no parenthesis

  • @moshe789 Basic algebra: the system sees the 5s as positive with a negative sign in front making the answer -625. If he'd typed (-5)**4, the answer would have shown 625.

  • @moshe789 =O... are you serious? Anyone with basic math skills can tell you thats the answer without thinking....

  • @moshe789 its correct

  • @moshe789 -(5^4) = -625

  • @moshe789 What he is saying is learn about Integers (numbers both positive and NEGATIVE) and you will see that when you use exponents with with a negative integer you will get a negative

  • @moshe789 its -625.

  • @moshe789 the negative before the Astrix, between the 3rd and 4th number 5 is not suppose to be there. The rest of it is correct in what you wrote 3 months ago. The two months ago is correct.

  • @moshe789 You mad bro?

  • This is brilliant, thank you! Looking forward to watching the rest of the tutorials.

  • @tuntuni1000 wat does it do

  • @theskaneesh Try it! ^^

  • @questionman5 that's exactly what I just said...

  • Well of course. When you do -5**4, you're actually saying 5**4 and put a negative in front of the answer. If you want the number of -5 to the 4th power, you have to do (-5)**4, which addresses the - sign and the 5.

  • You fool! Negative five to the fourth is NOT -625, it's 625!

    You need parentheses, otherwise you're asking, "negative one, times 5 to the fourth"

  • @TrumpetProductions that's because it has no parenthesis.. its like -(5^4).. you can check it using your calculator.. dont use the parenthesis..

  • at 1:25 I'm pretty sure he goes off on a racial slur tirade.

  • @Theocrasuck i think you mean @2:25 or so, haha "elementary school or high school or whenever you learned it"

  • I tried calculating googleplexia. It didn't work. Perhaps it was the parentheses. 

  • wammm bamm thank you mamamam

  • Oh, my so great language

  • my comp glitched on 999999999999999999999999999999­999999999999999999999999999999­999999999999999999999999999999­9999**999999999999999999999999­999999999999999999999999999999­999999999999999999999 ; ( i got scared

  • Two question bucky, what language do you prefer to program in? and why?

  • a negative number raised to an even number results in a positive number....

  • @tuntuni1000 I'll be picky and ask what takes the computer so long xP

  • Comment removed

  • Comment removed

  • u r my hero man :)

  • >>>5/2

    2.5

    what the hell, what's wrong with mine. I'm using Python 3.2

  • @Sketch9816 I think they've fixed it, ... :) Since it's a more updated version.

  • you are an amazing guy arent you??

  • @tuntuni1000 Its stoped to work Oo

  • What is the difference between raw_input and input.