docr.sg
  • Home
  • Playlists
    • C Programming
    • Mathematics
    • Scratch
    • Python
    • Apps
    • Computer Organization
    • Real-Time Operating Systems >
      • Mini-Project AY2021SEM1
      • Mini-Project AY1920SEM2
      • Mini-Project AY1819SEM2
    • Computer Systems
  • Code with your Kid
    • Photos
  • Code & Play
  • 10YS
  • CCF
  • thamizh
  • Publish
  • CONTACT
Picture

Python

Picture
Learn Python Programming through our wide range of videos. We start from basic concepts to advanced topics that include GUI development and Data Science with Python.

#Lesson 1

Download and Get Started!
The first thing we need to do to get started with Python is to download the software and install it.  Once we are done with that, explore and get excited! :)
Picture

#Lesson 2

Print It!
In this lesson, we will learn how we can create our own file and write some Python code that will then run in our Shell. We will also be looking at the 'print' command to send information to the shell.
Picture

#Lesson 3

Capture the Input!
In this video, you will learn how to use the "input" command to capture the user's input. You will also learn how to perform casting to perform a conversion between different data types.

Assignment 1

You own Calculator

Question

Develop a simple calculator that will take in TWO numbers as inputs. Subsequently, it will perform the basic operations of add (+), subtract (-), multiply (*)  and divide(/).
Picture

Answer

#Lesson 4

Multiple Inputs Together!
In this lesson, we learn how we can use the split() functionality together with input() so that we can capture several input parameters at the same time.

#Lesson 5

What if?
Here we discuss the "if" statement in Python and how we can use it to selectively execute code.

#Lesson 6

If not this, else what?
Here we explore the "if-else" statements we can use in Python for decision making.

Assignment 2

Who is Bigger?

Question

Ask the user to enter TWO numbers on the same line. Do a simple comparison and then print out the bigger number.
Picture
Picture

Answer

#Lesson 7

If, elif, else...
In this video we look at the if, elif, else sequence of checks. This extends upon the Assignment 2 code that you have done.

#Lesson 8

Nest my if...
In this lesson, we learn about the nested "if" statements to see how we can have multiple layers of checks for our data.

#Lesson 9

Loop till you Drop!
In this class, we introduce you to Loops using the "while" statement. Learn how to create a loop that executes statements continuously based on a logic check.

Assignment 3

Get your Grade!

Question

Ask the user to enter the marks. Based on the following range, print out their grade:
Picture

Sample Output

Picture

Answer


Assignment 4

Odd or Even?

Question

Create a Loop that will run for THREE times. Each time the loop runs, get an input from the user. Inform the user if the number entered was an Even or Odd Number.

Sample Output

Picture

Answer

#Lesson 10

What for what?
In this video, you will be introduced to the for-loop in Python. See how easy it is to get it done!

#Lesson 11

Play with the range()
In this lesson, we see how we can set the start and step values for the range parameters.

#Lesson 12

Nest My Loop!
We now look at Nested for-loops. Let's learn how the different loop counters change as we go through the code.

Assignment 5

Get your Grade!

Question

Prompt the user to enter the number of stars to be printed. Once the value is obtained, print a square of "stars" with each row and each column having the number of stars entered by the user.

This has to be done using nested for-loops.

Sample Output

Picture
Picture

Answer

#Lesson 13

To continue or to break?
In this lesson, we look at how we can use the continue and break statements to alter the operation of a loop.

#Lesson 14

Continue and break in a nest!
In this lesson, we understand the impact of the continue and break statements in a nested loop.

#Lesson 15

My type, My round!
We now look at Nested for-loops. Let's learn how the different loop counters change as we go through the code.

Assignment 6

Average it Out!!

Question

Prompt the user to enter the numbers, with a value of 999 to indicate the end of the input.
The code will then compute the average and print it out. 

The code must consider the case where there is no input. It must also print out the average up-to 2 decimal places.

Sample Output

Picture

Answer

#Lesson 16

Play with your String!
In this lesson, we explore Strings. We first understand how to calculate the length of a string. We then concatenate strings together. After that, we see how we can extract subsets of a string.

#Lesson 17

Split and Count!
In this lesson, we learn how to use the split and count functions for Strings.

#Lesson 18

Find and Replace!
In this lesson, we learn how to use the find function to search for subsets in a string. We also look at how to replace subsets in a string.

Assignment 7

Keep Counting!

Question

Given any string, find the index of each occurence of a sub-string within it. 

Sample Output

Picture

Answer

#Lesson 19

Is my title upper or lower?
Now we look at the title(), upper() and lower() functions that we can use for strings. Learn how to check for the case of a string and do conversions between the different cases.

#Lesson 20

Format my String!
In this lesson, we learn how to use the format operator to dynamically change the information printed on the screen.

#Lesson 21

Function your Future!
Functions provide you with a great way to modularize your code and make it more reusable.
​Let's get started with Functions. 

Assignment 8

Guess The Number!

Question

Prompt the User to Enter a number within a range. Based on the guess, inform the player if the the answer is correct. If not, provide a hint by saying if its higher or lower.

Sample Output

Picture

Answer

Picture

#Lesson 22

Function Some More!
Let's see how we can allow multiple input parameters for a function.
Picture

#Lesson 23

Let's talk about Recursion
Let's talk about Recursion...
Let's talk about Recursion...
Let's talk about Recursion...
Picture

#Lesson 24

Factorial with Recursion
Compute the Factorial of a number using Recursion!
Picture

#Lesson 25

Recursion Analysis
Let's analyze the whole Recursion Process!
Picture

Assignment 9

A Complete Calculator!

Question

Develop a Complete Calculator that prompts the user for the input numbers as well as the desired operation. Keep going in a loop till the user wants to end the program.

Sample Output

Picture

Answer

Picture
Picture
© COPYRIGHT 2018. ALL RIGHTS RESERVED.
  • Home
  • Playlists
    • C Programming
    • Mathematics
    • Scratch
    • Python
    • Apps
    • Computer Organization
    • Real-Time Operating Systems >
      • Mini-Project AY2021SEM1
      • Mini-Project AY1920SEM2
      • Mini-Project AY1819SEM2
    • Computer Systems
  • Code with your Kid
    • Photos
  • Code & Play
  • 10YS
  • CCF
  • thamizh
  • Publish
  • CONTACT