Get 2 masterclasses in 1.

Learn development, design, artificial intelligence, and data science!

10 levels of coding to take you from newbie to expert and give you a thorough introduction to various fields in tech. Change your life and skyrocket your career with this ultimate course for all.

Click here to enroll

210 hours and bonus content

Level 1: Introduction to Coding Fundamentals
Level 2: Web Development
Level 3: Complete App Development
Level 4: Build Games and Art Assets
Level 5: Learn Artificial Intelligence
Level 6: Introduction to Machine Learning + Software
Level 7: Machine Learning in Android Studio Projects
Level 8: Build Image Recognition Apps
Level 9: Build Scientific Analysis Apps
Level 10: Increase Efficiency of Machine Learning Models
+ 130 bonus topics raised by our backers on Kickstarter. Thank you for supporting online education!

Mastery of Artificial Intelligence in Unity for 2D and 3D Games

Do you want to learn how to use AI in games? Learn now with our beginner courses. Anyone can become a next generation game developer with these powerful tools!

All are 98% off today!

1. Learn Unity AI by Making a Tank Game​

Learn artificial intelligence, use the a star algorithm, & code in C#. Make an awesome 2D tank game.

Make a Pathfinding Game in Unity with A* AI

Welcome to Mammoth Interactive’s A* course with Glauco Pires. You will learn how to make a game that uses artificial intelligence.

Get a coupon

Take your first steps in AI here.

You will make a path-finding algorithm called ‘A star.’ You can use A* in many different platforms, programming languages and more.

This course’s topic is bulletproof knowledge.

You will learn how to use the A* algorithm to make a 2D game in Unity. A Super Tank on a maze will find the best way to go to a point you click. The tank will collect objects along its path.

Meet your teacher Glauco Pires

Glauco has a decade’s experience in game development. He makes games in UnityUnreal, and HTML languages. He works with languages like C#, C++, and JavaScript.

  • straightforward coding skills
  • clean development techniques
  • thoughtful developer advice

With Glauco you will learn to make games in the most efficient and cleanest way possible.

Get a coupon

Why you need artificial intelligence in games

With artificial intelligence, you can make your games more…

  • complex
  • random
  • interesting
  • valuable

…without putting in more effort thanks to algorithms.

Old games – the very first computer games – were simple and straightforward.

These days, you must make more complex games. Players want to believe they are playing against something complex, something lifelike.

The power of the A* algorithm

The A* is the base algorithm for path finding. A* is artificial intelligence that will find a path. This algorithm has existed for decades.

A* gets one agent (intelligent being) and takes it from point A to Point B. A* finds an optimal way to move. In real life, this power is useful for airplanes and cars.

A* is also important to avoid dangers like a cliff while getting to a destination. As well – suppose a game’s level has two paths. You can program your artificial intelligence player to think on its own. It can choose a better path to avoid monsters and other obstacles.

You must learn to use the A* algorithm. You will become a better game developer.

Requirements

Enroll now

The power of this algorithm will push your games to the next level.

Learn to be a technical and creative thinker. Glauco is an innovative instructor who gets great reviews.

This offer won’t last forever – sign up now to meet Glauco

2. Make a Starship Unity Game Powered by Artificial Intelligence

Mine a unique world using NavMesh AI. Make a 3D pathfinding game with C#.

Welcome to our Steering Behaviors course for Unity game development.

Implement realistic agent movement while making a 2D Unity game! In this course you will learn one of many aspects of artificial intelligence.

Get a coupon

This course was funded by a wildly successful Kickstarter

You will learn to make game elements behave like real-life beings. Your on-screen agents will move more smoothly than ever before.

Make and code a better game.

How can you make game characters move with realism, intelligence and little effort from you? Enroll in this course to learn everything you need to know to start using Steering Behaviors in your own games.

With Steering Behaviors enemies and players alike will follow automatic paths or seek pre-set positions in a smooth manner. These cool game behaviors allow characters to take smooth turns, slow down, speed up – you name it. Unity Steering Behaviors handle steering and movement.

Any game with motion needs this behavior to become better and stand out from competition.

We will use this behavior by making a minimalistic game where you must dodge enemies for as long as you can. Sign up now for this course.

Learn by doing in this practical course.

You will make a colorful 2D space dodger game where you play as a simple spaceship gliding around a level. Explore path following behaviors for the Unity game engine. Steer, flee, avoid obstacles, follow the leader and more.

Get a coupon

The possibilities are endless.

Enroll now

3. Make a Starship Unity Game Powered by Artificial Intelligence

Mine a unique world using NavMesh AI. Make a 3D pathfinding game with C#.

Explore with a smart character. Learn to build a spaceship on a planet.

Welcome to Mammoth Interactive’s NavMesh course with Glauco. In this course you will program a spaceship in a three-dimensional game.

Get a coupon

With artificial intelligence your ship character will learn to explore a planet. The ship will travel around craters, rocks, aliens and buildings in a 3D world.

You will make a good pathfinding system to find the best path for the player to navigate to wherever you click.

A navmesh is the perfect solution for navigating any space. You will use a navigation mesh or ‘navmesh’ to add artificial intelligence to your game. Your characters will move intelligently through levels and scenes.

Push your games to stand out.

Pathfinding logic makes a game looks real. You must learn to use NavMeshes. You will become a better game developer.

4. Unity Machine Learning with Python

Teach a sled controlled by artificial intelligence to catch falling Christmas presents!

Learn to work in an exciting area of computer science and artificial intelligence.

In this course we will train an artificial brain to make the game work. No matter where the present falls, the computer will know exactly how get it.

Click to get a coupon

Make an AI Christmas game!

Our Unity game will have a holiday setting featuring a sled. Presents will fall from the sky. The goal will be to move the sled to catch the falling present. The game will need no human interaction.

Enroll now to study with 5/5 star-rated instructor Glauco.

To catch a present present in the game, you as a player will not have to do any work! We will teach the computer to recognize the present’s location.

While making a simple scene, we will learn many settings and adjust programs. The result will be fantastic.

Get a coupon

Scaling my business by making games and tutorials

This developer is using only Apple products for his next game Escape Code. Game developer and online course pioneer John Bura talks about why his education company also makes video games.

John Bura’s Background

The first time I ever coded was at my local university. I was 12. I spent my summer coding in C++ and Visual Basic. In the 90s there was a huge rage for Visual Basic, a programming language from Microsoft. I made small games, and I enjoyed it.

I wanted to make an Xbox 360 game, but that required coding in C# and XNA. There were virtually no courses that showed you how to do this. I bought a DVD set and learned from that. Soon I came out with my Xbox game.

My career skyrocketed as a result. Several apps on the App Store later, people asked me, “John, how do you make an app? How do you make a game?”

In response to my followers, I made a huge 50-hour tutorial on how to make a game from scratch, including art, music, and coding. That became a runaway hit. I became the first instructor on Udemy to teach through practical projects. I became a top seller on Udemy, and the rest is history.

A screencap from our Mobile Machine Learning course by instructor Nimish Narang

A screencap from our Mobile Machine Learning course by instructor Nimish Narang

I started Mammoth Interactive, my online education company. It began with me making tutorials in my bedroom. But I wanted to grow the business.

Scaling a Business

One of the best ways to scale the online education side of Mammoth Interactive was to make as much content as possible. When I began hiring people to work with me, I thought I could hire someone and they’d make a quarter to half as much money as I made. I thought I would hire 1 to 2 people a month. That totally didn’t work. Though I did grow my team, I didn’t scale at such a high rate.

I found out that the online education market that we’re in is a subset of a bigger market: the online instructor marketplace market. Right now, there are few players on the market of online education platforms. As such, scalability is limited on many platforms, such as Udemy.

What I Expected When Starting a Business

I thought the more courses I produced, the more money I would make. That is technically true. However, the percentage is nowhere near where I wanted it to be. We’re technically making more money right now than if I were a solo entrepreneur. However, the margins are much thinner.

I’m not the only one expanding my business. Lots of people who started on Udemy now have multiple people working for them. It’s becoming harder to be a solo entrepreneur in the space.

This echoes the game development space. Lots of developers like Atari began as individuals but expanded. The course market is going the same way. Every top solo instructor has at least a video editor or an assistant.

If you’re starting to make money as an online instructor, one of the best pieces of advice I can give is to outsource administrative tasks so that you can make more content. The more content you make, the more money you’ll make.

A screencap from our Mobile Machine Learning course by instructor Nimish Narang

A screencap from our Mobile Machine Learning course by instructor Nimish Narang

As you grow your team, at a certain point your returns will lessen. Still, the marketplaces reward productivity to a certain extent.

Helping Other Entrepreneurs

It’s unfortunate that scalability is limited. However, some scalability exists, which is good. The way to scale this side of the business is to put your courses on as many different sites as you possibly can. On your own site, you can offer great deals by bundling courses.

I want to grow Mammoth Interactive to a business that makes 10 million a year. I must pick the right platforms to do that. Since the instructor market is a subset of a bigger market, there is limited upside. If I want to become a 10-million-dollar company, I must branch out. It’s very clear that this is the answer. The answer is NOT to alienate any people or platforms that got us to where we are. We’ll always continue to upload our courses to as many different platforms as we possibly can because our students come from different areas.

A screencap from our Mobile Machine Learning course by instructor Nimish Narang

A screencap from our Mobile Machine Learning course by instructor Nimish Narang

Recently we have gotten a rise in interest for consulting. I love consulting small business, online instructors, other online companies, and startups if they need help. Remember: Mammoth Interactive is a bootstrapped company. Over the years, I’ve built Mammoth Interactive to be lean.

I’ve seen so many people waste money. I have so much knowledge on to save money that it’s worth other people’s time to hear what I have to say.

Email us about consulting opportunities: sales(at)mammothinteractive.com

How I Started Making Games

In 1997 I wanted to make a full 3D role-playing game (RPG) in my bedroom. My RPG game did not work. It failed so miserably. Despite this, I kept making games. Instead of making a massive game, I made compact projects.

I wanted to make games, but everyone was interested in my courses. So I did both.

I’ve always wanted to make creative games that people enjoyed. I’m the kind of guy that has too many ideas and not enough time or money. While making my online courses on web, game, and app development, I’m always prototyping. I have hundreds of prototypes on my computer.

With my new game Escape Code, I wanted to make a bigger project. I took my best ideas over the years and put them into Escape Code.

Get Escape Code for iOS     Get Escape Code for Mac

A preview of our game Escape Code - get it now!

A preview of our game Escape Code – get it now!

How I Made Escape Code

I made Escape Code using only Apple‘s tools: SpriteKit, Xcode, Swift, and Logic Pro X. Why? Because I genuinely like the way Apple builds their products. I’m a big fan of minimalism. Like Apple, I strive to make the focus of my company the end user experience. My goal places less emphasis on complex technology.

Besides SpriteKit, I like to use the game engine Construct 3. Both SpriteKit and Scirra‘s Construct 3 are easy to use, and I don’t become frustrated while trying to release a game. Frustration doesn’t lead to sales, and Apple knows this.

Why I Love Swift

With Escape Code, I wanted to use all Apple products in one epic app. Escape Code is made completely in the game platform SpriteKit, which uses the coding language Swift.

Before Swift came out, for years I’d wanted a Swift-like language for the Apple ecosystem. Coding in Apple’s old language Objective-C was hard. Very hard. Once Swift appeared, I spent 2 weeks learning everything there was to know about Swift. I produced a huge 80-hour course all by myself. It was the biggest course on Swift at the time.

I also did a ton of webinars and talked about Swift everywhere. Today it’s still my favorite language. I don’t like coding as much in any other language. Swift is easy and intuitive. Just like Apple, Swift’s minimalist approach and end user goal is something I resonate with. It’s what Mammoth Interactive is all about, too.

When someone takes our course, we don’t want them to get bogged down in any road block or obstacle. We want them to quickly understand how to do something and to make a product as fast as possible. I learned that from Apple.

The Best Kind of Educational Game

It was only logical for me to use Swift for a game in some way. The last thing I wanted Escape Code to be was an educational game. My least favorite educational games were those that asked “What’s 2+2?” and when you answered exploded a ship. Games like Civilization or SimCity are amazing games because they are fun and teach you a lot.

Civilization teaches you the history of technology in the best way possible. In fact, when I played its sci-fi version Sid Meier’s Alpha Centauri I learned so much about futuristic technology that I never would’ve learned in school. SimCity teaches you about great city design without bogging you down with a rote teaching style. There is too much mechanical teaching in many educational games.

I didn’t want Escape Code to be a brutal learn-to-code game. I designed Escape Code so that the mobile device player would have a fluid and optimized experience.

A preview of our game Escape Code - get it now!

A preview of our game Escape Code – get it now!

Challenges of Making a Game

The biggest design problem I had while making Escape Code was to make it easy to understand and add coding in a way that has never been done.

The last thing I wanted was for players to type a bunch of code on their mobile phones. This would not be fun to play. Instead I added a box where you input the answer to a coding related question. Players still must read the code. But the execution is simple.

A Plot Inside Code

The coolest part about Escape Code is that part of the plot happens throughout the code. Crucial plot points like in a movie appear as part of code challenges. You can’t get the full story without reading the code.

Making a Game for Absolute Beginners

Since Swift is so easy to read, anybody – even if they don’t know how to code – can understand the code. Swift is intuitive and resembles natural human language. Anyone, regardless of programming experience, can follow the game thread by reading the code. Coding enhances the story.

A preview of our game Escape Code - get it now!

A preview of our game Escape Code – get it now!

Growing a Company

Escape Code is a momentous project for me because I didn’t do most of the work on the game. This is unique for me since my career is built on making projects entirely by myself.

I’ve been self-publishing since 2006. My first large entrepreneurial ventures were when I made 17 educational books and sold them all over North America. It was a wonderful learning experience for me, and it set the tone for the rest of my career. Since then I’ve done most of the work myself on a project.

Even when I produced my 80-hour Swift course (now updated) – I did everything. Video editing, sales copies, email marketing, recording, programming. Everything that had to do with the course, I did.

Learn to make 3D environments in this course by instructor Kevin Liao

Learn to make 3D environments in this course by instructor Kevin Liao

I was a solo entrepreneur until 2016. That’s when Mammoth Interactive became more than just one person. Today lots of people work for me at Mammoth Interactive.

Team Mammoth

Team Mammoth

Scaling a company has been hard. It’s just as hard as starting a company. Some might say it’s even harder.

From Solo Developer to Game Team

I’ve always made games by myself: art, music, and programming. With Escape Code, I wanted to be the director. With its 14-month production cycle Escape Code took way longer than I had expected. The game cost 2 times what I’d wanted to pay. Despite that, I’m pretty happy with the way Escape Code turned out.

It was difficult to convey vision and feedback to my Escape Code teammates because we don’t work in the same location. I had to figure out so many ways to express what I know to the developers. Of course I can code a game. But there’s a huge difference between directing people to do things and doing things yourself.

It may seem counter intuitive but having help can be harder than working alone. I wanted to try splitting tasks of making a game. Mammoth Interactive was a good place at where I could do this. There were lots of problems that came along the way. I had to find innovative solutions.

How We Make Courses and Games Efficiently

At Mammoth Interactive I have a 10 10 10 Rule. That means make a product 10 percent better, 10 percent faster, and 10 percent more money. The first 2 you can control. The last one is the hardest to do.

By following the 10 10 10 Rule, we have become the fastest people to make courses in the industry. Our time to market is so short that we constantly surprise our partners on how fast we can get things done. Our efficient production practices took years to make work.

Learn to make 3D environments in this course by instructor Kevin Liao

Learn to make 3D environments in this course by instructor Kevin Liao

With games I have the same pattern of making products fast. After prototyping for years, I know how to get a concept out the door fast.

Challenges of Being a Game Developer

The biggest bottleneck for me is the time it takes to make a game with 50 levels. It’s hard for me to do everything at once for a game with a bigger scope. It’s hard for any one person to do everything at once. I call it production fatigue.

Production fatigue is when you work too hard on a project and could easily complete its final tasks, but you lose willpower. Whether you’re learning how to code or wanting to be a producer, plowing through production fatigue will get you through many doors.

It’s hard to do. After creating and being an entrepreneur since I was 17, I pick my battles. Some battles are not worth picking.

Production fatigue is like hitting the wall as a long-distance runner. I’m not a long-distance runner, but from all the runners I know, the wall is the hardest part. You begin running and you want to stop so bad, but once you get past a certain point, running becomes easy.

This Game Took Twice as Long to Make, But It’s Worth It

I wanted to get Escape Code out in 6 months. This game would have taken me 3 months to do by myself, but it ended up taking 14. Luckily, Apple recently enabled app pre-orders. Pre-order Escape Code right now on the iOS and Mac App Stores!

Get Escape Code for iOS     Get Escape Code for Mac

Surprising Positives with Apple Pre-orders

Even if your project takes too long and goes over budget, an event can happen that benefits the project. If I’d released Escape Code 6 months ago, I wouldn’t have been able to put the game up for pre-order.

Pre-orders on the App Store are such a good idea. They’re a great way to help fund your game before you can release it. It would be awesome if Apple had its own crowdfunding site. You can’t do Kickstarters for iOS apps because Apple doesn’t allow redeeming of coupons on the iOS App Store.

We have had success crowdfunding projects on Kickstarter. A lot of you know that we are on Kickstarter quite a bit. The reason is that crowdfunding is a whole other stream now. Pre-ordering is as big a stream as actual sale.

The popularity of pre-ordering and crowdfunding is due to a shift in consumer thinking. Funding a product before it’s released has been normalized.

Every project we do we will try to put it on Kickstarter. It’s unfortunate Kickstarter won’t let us do multiple Kickstarters at the same time. Every project we do takes money, and we’re a project by project company. Be on the lookout for Mammoth Interactive Kickstarters. In the future we hope to see crowdfunding for iOS apps.

A Project Focused Company

As I mentioned, I have way too many ideas. Right now, I have 20 games that I’m trying to get out as soon as I possibly can. Small games – coffee break games. Escape Code is a medium-sized game, and I have plans for major games.

Before I even consider getting funding, I want to prove myself in the marketplace. Mammoth Interactive is entirely bootstrapped. That means we make a product such as a course or game, make money off that product, and reinvest the gains into another product. A lot of other technology companies find funding completely differently.

Many tech companies funding from a VC (venture capital) firm, and they get millions of dollars for a product that may or may not work. Over the last ten years I have a good record of accomplishment of making profitable projects. One day I might even get VC for a product. I do have some games that would be awesome.

I would like to bootstrap the games side of Mammoth Interactive first. Our education side is going well, and we will make a lot of fantastic courses coming up.

How We Make Courses

At Mammoth Interactive, our instructors make courses as well as individual products. I want to set up my company as Valve, the creator of Steam, has. The concept is a big room with modular teams and products. Developers and teams can collaborate and make small products.

I have a big theory on how to build a company called Mosaic development. It’s how I built Mammoth Interactive. I’ll probably do another article about this and write a book about it one day because it’s such a great idea and works so well.

Mammoth Interactive is a place where creators get stuff done. It’s not a place for people to go, get a paycheck, and come home. Our system is not for everybody, and I totally understand that. When I was new to the job market and worked for others, I felt useless and like a cog in a machine. Whether I showed up to work or not was not important. The company would still exist whether I showed up and “got work done” that day.

 

When I started Mammoth Interactive I wanted to make sure instructors produced something. A construction worker can point to a building and say, “I built that.” Ten years down the road they can point out the things they’ve made.

One summer in university, I worked as a landscaper. We began on a big field of dirt. We transformed it into a suburban park with trees, a playground, and sod. It’s common in the construction industry to accomplish this. Tech companies don’t do this.

Most companies are bogged down in meetings and trivial processes. At Mammoth Interactive, we make work meaningful and feel like you’re doing something every day – not just showing up and going home.

Why We Make Tutorials

One problem I’ve run into is that some developers only want to develop. They don’t want to make tutorials. Developing tutorials is like meditating. It’s one of those activities that doing a lot of improves your skills.

Programmers don’t understand that going back to the fundamentals and explaining them to a beginner makes you a better coder. It’s good for you whether you like it or not.

At the same time, if I’m not producing a side project alongside teaching, I’m not as happy. Ideally as Mammoth Interactive grows we will be able to make more content – not just training content but small products. We’re a company of small products: it’s how we began. Releasing products frequently is part of Mosaic development and is why it’s so brilliant.

Escape Code took a long time. I’m happy with its results. It’s a good-looking game. I’m excited to see how many pre-orders we get.

There are more products coming out from Mammoth Interactive other than just the education side. While we still will always produce educational content to some degree, there will be a lot of other cool stuff, so stay tuned.

The Online Education Revolution

One of the best things about the rise of online education is that people can teach part time and do other things alongside. We’ve all heard the saying, “Those that can’t do, teach.” In the past the saying might have been true when teaching was often considered a “lesser” job. In the 20th century, growth was so incredible that if you knew how to do anything, it would pay more to do it than teach it. You were considered second-rate it if you just taught because that meant you couldn’t do.

This mentality lingers with us today because the post-high school education system focuses more on theory than practicality, depending on where you go. Today we’re in a whole different area, and it’s a better area. I’ll argue that you can’t be a good programmer without being a teacher. And vice versa: you can’t be a good teacher without doing things. Today you need to do both to some degree.

Anyone Can Learn at Mammoth Interactive

If you’re a great programmer but can’t explain programming basics to others, chances are your code is too complex. If your code is too complex, collaboration (especially on bigger projects) will be a liability rather than an asset. When you teach beginners, you distill your coding knowledge to its most basic form. It’s like reducing your fractions. You want your code to be the least complex and the most efficient.

Just like how newspapers and articles make their articles readable to a grade 6 level, you should make your code readable to as many people as possible. It should be easy to understand. There’s no better way to learn to do that than to make tutorials.

You don’t have to be a teacher. Anyone can benefit from simplifying things to others. If you’ve never done it before, you’ll find it surprisingly hard. At Mammoth Interactive we’ve found an easy way to do it. As mentioned, we’re the fastest in the business at releasing a product to market.

On the other side, if you don’t produce things, your teaching skills will worsen. Part of the beginning of my teaching online is when I ran into trouble making an iOS app. I solved the problems to make the app and decided to teach people based on my experience.

I taught how I solved problems one month prior. I showed students how not to do what I did. Making an app from scratch made me a great iOS teacher. Without my hands-on experience, I would have been any other teacher who puts up a curriculum and shows theoretical problems.

Learning through Practical Projects

Instead in my courses I show you the problems that can arise, just like how this article is talking about issues with scaling a company, making tutorials, and making a game.

The mindset to have about learning is to fail forward. You cannot improve without failure. Most people pass through the education system thinking failure is a bad thing. We are taught to fear failure far too much.

Since we are a part of a knowledge economy, some things will work out and some will not. Larger companies like Coke and others make products they don’t even know will sell but that they try regardless.

When a project fails, you must figure out why. On the next project you will do a better job. Especially if you follow my aforementioned 10 10 10 Rule.

When you improve on something, it’s not during the project – it’s between projects. We at Mammoth Interactive have such a short iteration cycle so that we improve as much as we can between projects. If you make a 2-year project, there’s little room for improvement. Smaller, simpler projects lead to a bigger mosaic.

Escape Code might completely fail. Apple might not pick it up. If I lose a lot of money, I will figure out why. Sometimes the reason your project fails is completely not up to you. Success is not always up to you either. Success can be random.

The way that I deal with this randomness is by producing a lot of products and ensuring each of them is barely profitable. You don’t trust one big product to take your company forward. Instead you build small products. You never know which one of them will take you to the next level.

I don’t think Escape Code will fail. I’ll probably at least get my money back. It’s too innovative to not do well. Check out our #1 coding mechanic, engaging puzzles, and go on an adventure!

Get Escape Code for iOS     Get Escape Code for Mac

Variables for Absolute Beginners: Free Python Tutorial

What are Python variables?

Let’s learn all about them! In this tutorial, you’ll learn how to use Python variables to code.

Want to code more? Enroll in our Python course – on sale today.

Variables are a way of storing information or data that you may want to keep for later, or for storing information you may not know yet.

For instance: suppose you’re writing code that will ask for user input. At the beginning of the code, you won’t know the user input, so you will store the user input in a variable.

Variables are convenient because they let you save information and use it later. Let’s look at an example of a variable below. Note that we’re using the development environment Spyder (Python 3.5) to test our code.

Suppose you’re writing code and want to store the number 1. You can declare (create) a variable to do so.

To declare a variable, write the variable name in the Editor, followed by an assignment operator, which is represented by an equals sign.

one = 

The preceding code declares a variable with the name one. one will be assigned the value on the other side of the operator. Let’s make the value 1 with the following code.

one = 1

You can use the same format to make variables with the values 2 and 3.

one = 1
two = 2
three = 3

With the preceding code, we created the variable two with the value 2. We also created the variable three with the value 3.

Thus we have 3 different variables that we can call. We can do different things with them, and they do not affect one another.

Printing Variables

To prove that we’ve created the variables successfully, we can use the print function. This function lets you print output to the screen so that you can see it. You can learn more about functions in our Python course. Right now, we’ll use one function so that we can see our variables in action.

Type the word print, which is the keyword for the print function. The development environment will color the word in purple.

one = 1
two = 2
three = 3

print

In parentheses after the variable name, you put the parameters of the function. In this case, the parameter will be the name of the variable you want to print. Let’s print one first using the following code.

one = 1
two = 2
three = 3

print(one)

On subsequent lines, use the same format to print two and three.

one = 1
two = 2
three = 3

print(one)
print(two)
print(three)

If you run the code by pressing the Run button, the console on the right side will print the values of the variables that we assigned earlier.

You can reuse variables. For example, the following screenshot shows that you can print the variables backwards.

What happens if you overwrite variables?

You can overwrite a variable (change its value) by assigning it a new value. For instance, the following code changes the value of two to 4.

one = 1
two = 2
three = 3

print(one)
print(two)
print(three)
two = 4
print(two)
print(one)

You will see in the console that before you overwrite the variable, the print function will print the variable’s initially assigned value. After the overwriting line, print will print the variable’s new value because you’ve overwritten the data.

You’ve changed the value of the data inside the variable. When you call the print function, your computer looks at the last known value and prints it to you. When you modify the value, the value stored inside the computer gets changed.

Types of Variables

We’ve created variables (one, two, three) of a certain type: integers. They are integers because their values (1, 2, 3, 4) are integers (whole numbers). You can create other types of integers.

For instance, the following code creates a variable that is a decimal. Note that the name of the variable can be whatever you wish, but it is logical to name it something that relates to its value.

one = 

The preceding code declares a variable with the name one. one will be assigned the value on the other side of the operator. Let’s make the value 1 with the following code.

Decimal = 1.1

Another type of variable you can make is a string. Use the following format to create a new variable named StringVar (to stand for string variable.)

StringVar

Notice that we capitalized the first letter of each word in this variable’s name. Although not required in Python, it is a naming convention and makes code easier to read.

A string is a series of characters. To declare a variable as a string, you can assign it a value in quotation marks. The following code gives StringVar the value "Hello".

StringVar = "Hello"

You can print this variable as well, using the same format for the print function.

StringVar = "Hello"
print(StringVar)

In Python, you don’t have to tell the computer what type you want a variable to be. Python automatically assigns a variable a type depending on the variable’s value. This differs from some other programming languages. You can simply assign a value, and the computer will store it in memory to be used later.

There are some rules, however. For instance, if you want to add a value to a variable, you can do so with the + operator. However, each variable can only be of one type. Let’s look at an example.

Suppose you want to add “1” to the end of StringVar. If you simply write + 1 to where you declared StringVar, you will get an error message. The console will print the TypeError “Can’t convert ‘int’ object to str implicitly.”

This error occurs because "Hello" is a string, whereas 1 is an integer. If you put quotation marks around 1, although 1 is still a number, the computer will interpret it as a string. You will no longer get an error message.

StringVar = "Hello" + "1"

All the variables we created are called global variables because they are not contained in any function. The variables are contained in the core of the code and aren’t in a subsection. As such, you can access them from anywhere.

An example of a local variable is a variable inside a function. For instance, the following code outlines how to set up a function. We provide more information on functions in our Python course.

def FunctionName(Input):
Action
return Output

You can declare a variable inside the function like so:

def FunctionName():
newVar = "World"
return

As such, newVar is a local variable. It is local to a function. You cannot access newVar from outside the function. You can call the print function on newVar in the function. The console will print the value of the variable: World.

However, if you try to print newVar outside FunctionName, the code will crash. Because newVar is locally defined, it doesn’t exist outside the function. Your computer will give you the NameError “name ‘newVar’ is not defined”.

def FunctionName():
newVar = "World"
return

FunctionName()
print(newVar)

On the flip side, you can use global variables inside functions. For instance, you can call the one variable by simply typing its name in FunctionName. However, to let other developers know or to remind yourself that one is global, you can write the keyword global before the variable name.

def FunctionName():
global one
newVar = "World"
return

Comment out the line print(newVar) that is outside FunctionName so that we don’t get any errors. To comment out a line, add a hashtag to the beginning. The console will skip over any commented lines.

def FunctionName():
global one
newVar = "World"
return

FunctionName()
#print(newVar)

Call print on one inside FunctionName. The console will print 1, the value of one that we defined earlier.

def FunctionName():
global one
print one
newVar = "World"
return

What else can you do with variables? There is another way to define variables that is a shorthand.

An alternate way to declare our variables one, two and three is with the following format:

one, two, three = 1, 2, 3

This code assigns the value 1 to one, 2 to twoand 3 to three.

What else can you do with variables?

You can create a new variable that is the sum of 2 values. For instance, the following code declares a variable five and assigns it the value 3+2. If you print five, the console will print the sum: 5.

five = 3+2

What can you not do?

You can’t use variables that are not yet defined. For instance, the following line would return an error because we have yet to declare a variable six.

five + six = 5

You also cannot declare a variable value-first. For instance, the following code would give the SyntaxError “can’t assign to literal”.

5 = five

This occurs because code to the left of the assignment operator (equals sign) is what you’re giving the value to, and code to the right of the sign is what the value is.

What are counting variables?

You will use counting variables a lot when programming. You can use counting variables to keep track of the number of times a certain event occurs. Let’s look at an example. Create a variable count, and give it the initial value 0.

count = 0

Call print on the count variable. Comment out all the other print lines so that you can clearly see what this example prints in the console. The console will print 0.

count = 0
print(count)

Let’s make the value of count 1. There are several ways we can do this. One way we’ve already seen: to overwrite the value with the following code.

count = 0
print(count)
count = 1
print(count)

Another way is to add a value to the variable with the following code.

count = 0
print(count)
count = count + 1
print(count)

The preceding code assigns the value of count to be count’s current value plus 1. With a print function, the console would print 1.

You can increment count‘s value in this way because it will always add onto the latest value. For instance, assign count the value count + 1 again, and print it. The console will print 0 1 2.

count = 0
print(count)
count = count + 1
print(count)
count = count + 1
print(count)

A shorthand notation to add a value to the current value of count is the following. This code will add to and redefine count.

count += 1

Similarly, you can multiply the value of count and reassign its value.

count = count * 3
print(count)

There is shorthand notation for this, too:

count *= 3
print(count)

The console will print 3 at this line.

You can divide the value of count and reassign its value.

count = count / 3
print(count)

There is shorthand notation for this, too:

count /= 3
print(count)

The shorthand is helpful because as you write more code, you will find that the more ways you can write less, the more efficient you will be as a coder.

Want to code more? Enroll in our Python course – on sale today.

In this course, you will learn how to code in the Python 3.5 programming language. Whether you have or have not coded before, you can learn how to use Python. Python is a popular programming language that is useful to know because of its versatility. Python is easy to understand and can be used for many different environments. Cross-platform apps and 3D environments are often made in Python.

We will cover basic programming concepts for people who have never programmed before. This course will cover key topics in Python and coding in general, including variables, loops, and classes. Moreover, you will learn how to handle input, output, and errors.

To learn how to use Python, you will create a functioning Blackjack game! In this game, you will receive cards, submit bets, and keep track of your score. By the end of this course, you will be able to use the coding knowledge you gained to make your own apps and environments in Python.

What students have said about our courses:

“He explains everything.. great course, great teacher.”

“The instructor tells us why we do things and breaks down everything so you will understand better.”

“Pace is excellent, iterates points without being redundant. Builds on previous knowledge in a very organic way.”

“Great course. Clear voice, good screen material. I liked it.”

“I absolutely love this course. I’m only part way through so far but felt compelled to leave a review. This is such a comprehensive course that was well worth the money I spent and a lot more!. Well done. Will definitely be looking at more Mammoth Interactive courses when I finish this.”

This course is project-based, so you will not be learning a bunch of useless coding practices. At the end of this course, you will have real-world apps to use in your portfolio. We feel that project-based training content is the best way to get from A to B. Taking this course means you learn practical, employable skills immediately.

Learning how to code is a great way to jump in a new career or enhance your current career. Coding is the new math and learning how to code will propel you forward for any situation. Learn it today and get a head start for tomorrow. People who can master technology will rule the future.

Get the course here!

6 skills every coder needs to get a job in 2018.

What it means to be a coder changes every year. Not only do you need hard skills (tech abilities), you also need soft skills, which concern the more human aspect of work.

1. The ability to take risks.

Image 1

Because projects can fail, it’s smart to have multiple streams of income. For example, if you design websites, have multiple projects going on at the same time. It is risky to take on a new project that you’re unsure will succeed. However, it’ll pay off in the long run because your income is diversified.

Get in the habit of making semi-predictable decisions and dealing with the loss. You must get comfortable with losing time or money on a project. The more comfortable you become, the more risks you’ll be able to take.

If you start a project – say, a game – and it fails, figure out what went wrong. Write down everything you can improve next time, and steps you can take to prevent the same things from going wrong. Then try again.

Even if a project fails, there is always something to learn from it. There will always be a next time as long as you don’t overextend on a project. By have multiple projects at once, you prevent yourself from overextending.

Be open to the risk it takes to accept new projects.

2. Self-Promotion

Image 2

In a world where the value of ‘me’ grows every day due to social media, your personal marketing skills become more important to your success as a coder. Not only are you marketing your skills – you’re marketing your personality.

A small business will look at what you’re like as a person to work with because they’ll be dealing with you every day. You have to be friendly but also know how to boast your talent.

Talking about yourself doesn’t have to feel sleazy. To be a tolerable – and better – self-promoter, simply talk about your projects and what you’re working on.

Be warm and open, and talk about your projects in a positive way. What you don’t want to do is spread negativity.

Self-promotion isn’t greedy. If you do it correctly, it is but a conversation.

3. Adaptability

Image 3

As technology changes, you have to keep learning. If you work at a small business or tech company, you might get new management or change locations or working styles. You have to be adaptable to what life throws you. I say, this keeps life interesting!

4. Clear Communication

Image 4

As a coder, understanding your team is crucial when working on projects. To deliver effective communication, think before you speak. When you talk to someone in person, bide your time before blurting out a response.

You can use the objects around you to fill time while you mentally form a clear response. When you meet someone for coffee, use your coffee cup to distract the person with an action while you think.

Alternatively, say, “Hmm, that’s a good idea,” and pause for a second. This shows your conversation partner that what they said requires your reflection. They’ll appreciate this – people love it when you think about what they say.

Of course, the way you offer communication varies with each situation. While going out for coffee with friends, you can respond slower and sit more casually than when you’re at a job interview that requires you to be professional and ready to answer.

If you do have miscommunication with someone, get feedback from the person on what you can alter so that the same miscommunication doesn’t happen again.

5. Long-Distance Communication

 

Image 5

Not only do you have to be able to communicate clearly in person, you also have to be able to do so online. To maintain a close connection with a virtual team, set up a team chat. A team chat is a chatroom where you can talk to your team members.

A team chat is a great place to share information about your project or have a bit of fun. Because technology is so prevalent in our daily lives, it’s only natural to have a digital conversation with your coworkers about topics. You can post anything like funny videos or gifs in this team chat.

There are many different programs that you can use for team chat. We at Mammoth Interactive use Discord, which allows us to categorize our conversations.  

6. Divergent Thinking

Image 6

Get inspiration from outside your field. Even if you’re a coder, this doesn’t mean you have to only watch coding tutorials. Learn about an adjacent topic, such as design. This will allow you to cross-pollinate your ideas and skills, which will increase your creativity.

Even if you think, “I never use this skill at my job,” you’ll surprise yourself by being able to apply a seemingly unrelated skill that you watched a short tutorial on. Fast, compact courses are great for this. We have many courses perfect for this kind of learning, including:

Divergent learning and thinking will make you better at reverse-engineering ideas. After all, it’s been said there’s no such thing as a new idea but rather the same one changed around for the times.

Reverse-engineering is like taking apart a clock and rebuilding it. It means getting inspiration from what’s popular in order to stay relevant and, well, in business.

To learn more about skills that will better yourself as a candidate in your field, enrol in our Soft Skills course.

Sign up for our newsletter.