You are on page 1of 9

INDIAN SCHOOL WADI KABIR INTERNATIONAL

Digital Literacy: Grade 7


Python and Movie Making

What is Python?
Python is a very popular general-purpose interpreted, interactive, object-oriented, and high-level
programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python
source code is also available under the GNU General Public License (GPL).

Python Data Types


Python Data Types are used to define the type of a variable. It defines what type of data we are
going to store in a variable. The data stored in memory can be of many types. For example, a
person's age is stored as a numeric value and his or her address is stored as alphanumeric
characters.

• int (signed integers) - 2,3,4………


• float or real values (floating point real values) – 2.4,3.4,5.6………
• Character – char – ‘a’, ‘v’, ………
• String – “eleven”, “hello”, ….
• Boolean – True or false
Variable:
Variables are the reserved memory locations used to store values within a Python Program. This means
that when you create a variable you reserve some space in the memory.
A Python variable is created automatically when you assign a value to it. The equal sign (=) is used to
assign values to variables.
counter = 100 # Creates an integer variable
miles = 1000.0 # Creates a floating-point variable
name = "Zara Ali" # Creates a string variable

Printing Python Variables


Once we create a Python variable and assign a value to it, we can print it using print() function.
Following is the extension of previous example and shows how to print different variables in
Python:
counter = 100 # Creates an integer variable
miles = 1000.0 # Creates a floating-point variable
name = "Zara Ali" # Creates a string variable

print (counter)
print (miles)
print (name)
Algorithms:
Algorithm is a step-by-step procedure, which defines a set of instructions to be executed in a certain order
to get the desired output. Algorithms are generally created independent of underlying languages, i.e. an
algorithm can be implemented in more than one programming language.
How to Write an Algorithm?
There are no well-defined standards for writing algorithms. Rather, it is problem and resource
dependent. Algorithms are never written to support a particular programming code.

Example
Let's try to learn algorithm-writing by using an example.
• Problem − Design an algorithm to add two numbers and display the result.
step 1 − START
step 2 − declare three integers a, b & sum
step 3 − define values of a & b
step 4 − add values of a & b
step 5 − store output of step 4 to sum
step 6 − print sum
step 7 − STOP
Algorithms tell the programmers how to code the program. Alternatively, the algorithm can be
written as −
step 1 − START ADD
step 2 − get values of a & b
step 3 − sum ← a + b
step 4 − display sum
step 5 – STOP

Flowcharts
Flowcharts graphically represent the flow of a program. There are four basic shapes used in a flow
chart. Each shape has a specific use:

• oval: start / end


• parallelogram: input / output
• rectangle: calculations
• diamond: selection structures
Arrows connect the basic shapes in a flowchart. The shapes and arrows of a flowchart describe
the flow of a program from start to end. Flowcharts typically flow from the top to the bottom or
flow from the left to the right. Below is the description of a simple program:

The program starts. Then the program prints out "Output!". Finally, the program ends.

A flowchart that describes this simple program is shown.


The Python code that corresponds to this flowchart is:

# start
print("Output!")
# end

A description of a program that includes a calculation is below:

The program starts. Next, the program asks a user for a number. Two is added to the number.
Next, the resulting sum is printed. Finally, the program ends.

A flowchart that describes this program is is shown.

Programs:

Q1: Write a python program to add two numbers.

num1=float(input("Enter the first number: "))

num2=float(input("Enter the second number: "))

sum_result=num1+num2
print(f"sum:{num1} + {num2} = {sum_result} ")

Q2: Write a Python program to calculate the area and perimeter of the square.

s=int(input("Enter side of square "))

a=s*s

p=4*s

print("Area = ",a)

print("Perimeter = ",p)

Q3: Write a Python program to calculate the area of the triangle.

base = float(input("Enter the length of the base of the triangle: "))

height = float(input("Enter the height of the triangle: "))

area = 0.5 * base * height

print(f"The area of the triangle is: {area} ")

Q4: Write a Python program to calculate the area and perimeter of the rectangle.

length = int(input("Enter the length of the rectangle: "))

width = int(input("Enter the width of the rectangle: "))

area = length * width

perimeter = 2 * (length + width)

print("The area of the rectangle is:", area)

print("The perimeter of the rectangle is:", perimeter)

Q5: Write a Python turtle program to draw a square.

import turtle

t=turtle.Turtle()

turtle.bgcolor("red")

t.pensize(10)

t.forward(100)
t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

Q6: Write a Python turtle program to draw a circle and fill color.

import turtle

t=turtle.Turtle()

turtle.bgcolor("blue")

t.pencolor("purple")

t.fillcolor("orange")

t.pensize(10)

t.speed(4)

t.begin_fill()

t.circle(90)

t.end_fill()

Q7: Write Python turtle program to draw a triangle.

import turtle

t=turtle.Turtle()

t.pensize(5)

t.pencolor("green")

t.forward(100)

t.left(120)

t.forward(100)

t.left(120)
t.forward(100)

Q8: Write a Python turtle program to draw a hexagon.

import turtle

polygon = turtle.Turtle()

my_num_sides = 6

my_side_length = 70

my_angle = 360.0 / my_num_sides

for i in range(my_num_sides):

polygon.forward(my_side_length)

polygon.right(my_angle)

turtle.done()

Q9: Write a turtle Python program to draw a pattern with squares.

import turtle

t=turtle.Turtle()

turtle.bgcolor("red")

t.pensize(10)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.forward(100)

t.right(90)

t.forward(100)
t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

t.right(90)

t.forward(100)

Movie Making
Windows Movie Maker is divided into three main areas: the panes, the storyboard/timeline, and the preview
monitor. Windows Movie Maker provides several different panes that you can work in, depending on which
tasks you want to complete.
Characteristics of Window Movie Maker:
Windows Movie Maker allows you to quickly build a personalized movie that incorporates video, still
images, background music, and narration. This movie can be customized further by adding titles,
transitions, and video effects.
What are the groups in the Windows Movie Maker ribbon?
Movie Maker's interface consists of the "ribbon toolbar, preview window", and timeline. Ribbon Toolbar -
This comprises of main toolbars which are Home, Animations, Visual Effects, Project, and View.
Reference:

https://www.tutorialspoint.com/python/python_overview.htm

https://problemsolvingwithpython.com/08-If-Else-Try-Except/08.06-Flowcharts/

You might also like