© 2019 BrainStemSchool.com

December 13, 2016

December 9, 2016

December 7, 2016

Please reload

Enough Talk, Let's Get Coding

November 16, 2016

 

https://youtu.be/T4tZSbqRd-8

 

Python, unlike Java, C++, and many other languages, has very little code overhead. Everything you learn can be immediately used in code. For instance, pop over to https://repl.it/languages/python3 and type the following classic line of code:

 

print("Hello, World!")

 

As you would suspect, it outputs simply:

 

Hello, World!

 

There's no input and not really any processing here - just output: the computer giving data to the user.

 

You can also print numbers:

 

print(10)


print(3.14)

 

and math expressions:

 

print(5 + 5)

 

prints 10 as expected.

 

HOWEVER,

 

print(5.0+5.0)

 

prints 10.0 ... What's up with that?

 

The short answer: 5 is an integer, 5.0 is a floating point. They have different Type.

 

Next Post: Mysterious Printing Type Errors

Share on Facebook
Share on Twitter
Please reload

Please reload

Recent Posts
Tags