top of page

Day 2 : Python Basics

Understand and learn the basics the python programming language.​​

Day 2 Quiz: Please take in order to gauge your understanding of Day 1 concepts

Based on the questions you get incorrect, please review the material from Day 1 to ensure your understanding before proceeding

Programming Language

  • As we know, to communicate with a person, we need a specific language, similarly to communicate with computers, programmers also need a language is called Programming language.

  • Before learning the programming language, let's understand what is language?

 

​What is Language?

  • Language is a mode of communication that is used to share ideas, opinions with each other. For example, if we want to teach someone, we need a language that is understandable by both communicators.

 

​What is a Programming Language?

  • A programming language is a computer language that is used by programmers (developers) to communicate with computers. It is a set of instructions written in any specific language ( C, C++, Java, Python) to perform a specific task.

  • A programming language is mainly used to develop desktop applications, websites, and mobile applications.

Python is one of the most widely used user-friendly programming languages. It is an open-source and easy to learn programming language developed in the 1990s. It is mostly used in Machine learningArtificial intelligence, Big Data, GUI based desktop applications, and Robotics.

Advantages

  • Python is easy to read, easy to understand, and easy to write.

  • It integrates with other programming languages like C, C++, and Java.

  • Python executes code line-by-line, so it is easy for the programmer to find the error that occurred in the code.

  • Python is platform-independent means you can write code once and run it anywhere.

Disadvantages

  • Python is not suitable for developing mobile applications and games.

  • Python works with the interpreter. That's why it is slower than other programming languages like C and C++.

Python-logo-notext.svg.jpg

Python Programming Introduction

The syntax of the Python programming language is the set of rules that defines how a Python program will be written and interpreted (by both the runtime system and by human readers).

Comments:

1. Open up the Thonny Application that was previously installed

2. Make sure your screen in empty with no lines

3. Follow along with the videos below in order to get a firm understanding of variables, data types, and functions

Python Variables

Make sure to follow along in your own Thonny application. Pause and play video as needed.

Variable
Data Types

Make sure to follow along in your own Thonny application. Pause and play video as needed.

Python
Functions

Make sure to follow along in your own Thonny application. Pause and play video as needed.

For Loops

Make sure to follow along in your own Thonny application. Pause and play video as needed.

While Loops & Comments

Make sure to follow along in your own Thonny application. Pause and play video as needed.

Challenges

Challenge 1: Write a program that will print your name 30 times using a while loop.

Challenge 2: Write a program that will use a for-loop to print your favorite food 100 times.

Challenge 3: Write an if and else statement that compares two numbers

Challenge 4: Create three variables that are assigned different Strings of your choice and print them out

Challenge 5: Create two variables and assign them to two different numbers; Use and if and else statement to compare the variables

Challenge 6: Create a variable that equals a number and write a while loop that will print out the variable 20 times.

Complete all of these challenges without looking at the solutions. If you are very stuck and have spent at least 30 minutes in trying to get a challenge complete, then look at a solution. Use the solutions as a very last resort and if you are still confused email groundupcs@gmail.com with any questions you may have. 

Challenge 1 Solution
Screenshot 2023-09-04 at 7.05.37 PM.png
Hover over to see the solution
Challenge 2 Solution
Hover over to see the solution
Screenshot 2023-09-04 at 7.22.53 PM.png
Challenge 3 Solution
Hover over to see the solution
Challenge 4 Solution
Hover over to see the solution
Challenge 5 Solution
Hover over to see the solution
Screenshot 2023-11-22 at 12.55.25 PM.png
Challenge 6 Solution
Hover over to see the solution
Screenshot 2023-11-22 at 12.58.06 PM.png

Congrats, you have just learned the fundamentals of the Python programming language!

Day 2 Complete.

bottom of page