Last night, Owner decided not to feed me since he was working on Ken’s topics. I saw him using the input function and all I could think of was food… I was starving. So when he went downstairs to get some food, I crawled to the keyboard and wrote:
When he returned, he saw a program. He ran it and I ate. Everyone’s happy now. :D What input does is it stops the program until the user running it inputs what’s asked.
As everyone knows, life has its colors. Python does as well, everything you write is something, and those somethings have names. Owner taught me that while he gave me a “somethingberry”…
But he also tells me to bite small so I don’t choke myself… So lets bite small.
Variables
Variables are like the “berries” of Python. You can have STRAWberries, you can have RASPberries, you can have BLUEberries but they are all a part of the berries family.
Variables include numbers. Numbers are what the name says they are, numbers, but numbers have types also:
Int: a simple whole number. (Integer)
Long: a REAAAAAALLY long number.
Float: A number with decimal point.
Complex: A complex number. It’s usually written like: (9-4j) where 9 is the real part and the number followed by the letter “j” is the imaginary part.
You can also have another “berry”: Strings.
Strings are just characters (text or numbers) enclosed by a quotation marks. You can do all sorts of things with strings like write them lots of times by putting a * or add things to them. This image shows mostly everything <3
Owner did something cool today, he printed a message. I got really excited since I wrote the message! :D
All he had to do to print the message was type in “print(””)” and I got to walk over the keyboard to write the message! Today was a good day.
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Undefined array key 1 in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 113
Warning: Undefined array key 1 in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 117
Warning: Undefined array key 1 in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 127
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Trying to access array offset on value of type bool in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 68
Warning: Undefined array key 1 in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 113
Warning: Undefined array key 1 in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 117
Warning: Undefined array key 1 in /home/kenbauer/public_kenscourses/tc101fall2016/wp-content/plugins/category-posts/class-widget.php on line 127