0% found this document useful (0 votes)
3 views3 pages

G7 Python Code

The document outlines a series of programming tasks designed to teach basic Python concepts, including output statements, input handling, arithmetic operations, and conditional statements. Each task includes a specific concept and a challenge to modify or expand the code. The tasks range from simple print statements to more complex calculations and debugging exercises.

Uploaded by

jayita.saha11
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

G7 Python Code

The document outlines a series of programming tasks designed to teach basic Python concepts, including output statements, input handling, arithmetic operations, and conditional statements. Each task includes a specific concept and a challenge to modify or expand the code. The tasks range from simple print statements to more complex calculations and debugging exercises.

Uploaded by

jayita.saha11
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1.

Simple Output Program


Concept: print statement

print("Welcome to Python programming")


print("My name is Siri")

Task:
Change the name and message.

2. Input and Output Program


Concept: input() and variables

name = input("Enter your name: ")


print("Hello", name)

Task:
Make it say: Welcome to Grade 7 Computing, <name>

3. Addition Program
Concept: variables + casting + arithmetic

num1 = int(input("Enter first number: "))


num2 = int(input("Enter second number: "))

total = num1 + num2

print("The total is", total)

Task:
Test with different numbers.

4. Multiplication Program
Concept: arithmetic operators

num1 = int(input("Enter a number: "))


num2 = int(input("Enter another number: "))

result = num1 * num2

print("The result is", result)

Task:
Change it to division.
5. Area of a Square
Concept: real-life calculation (from scenario in book )

length = int(input("Enter length of square: "))

area = length * length

print("Area of square is", area)

Task:
Ask: What happens if length = 5?

6. Average of Three Numbers


Concept: multiple inputs + calculation

num1 = int(input("Enter first number: "))


num2 = int(input("Enter second number: "))
num3 = int(input("Enter third number: "))

average = (num1 + num2 + num3) / 3

print("Average is", average)

Task:
Write why the answer can be a decimal.

7. Simple IF Condition Program


Concept: selection (IF statement)

marks = int(input("Enter your marks: "))

if marks >= 50:


print("Pass")
else:
print("Fail")

Task:
Change condition to 80 for “Excellent”.

8. Compare Two Numbers


Concept: comparison operators

num1 = int(input("Enter first number: "))


num2 = int(input("Enter second number: "))
if num1 > num2:
print("First number is bigger")
else:
print("Second number is bigger")
9. Speed Calculator
Concept: formula-based program (from syllabus tasks)

distance = int(input("Enter distance (meters): "))


time = int(input("Enter time (seconds): "))

speed = distance / time

print("Speed is", speed, "m/s")

10. Debugging Practice (with error)


Concept: error detection

num1 = input("Enter number: ")


num2 = input("Enter number: ")

total = num1 + num2

print("Total is", total)

Task:
Find the error and fix it using casting.

You might also like