0% found this document useful (0 votes)
4 views

Python Assignment Day 2

The document outlines a Python assignment that involves creating variables for a name, age, and learning subject. It includes tasks to add two numbers and display the result, as well as to compare the two numbers. The improved Python code demonstrates these tasks with proper syntax and print statements.

Uploaded by

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

Python Assignment Day 2

The document outlines a Python assignment that involves creating variables for a name, age, and learning subject. It includes tasks to add two numbers and display the result, as well as to compare the two numbers. The improved Python code demonstrates these tasks with proper syntax and print statements.

Uploaded by

mosesmainam017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Software Development - Python Assignment (Day 2)

Original Assignment (Handwritten):

1. Create 3 variables in Python:

Name = "moses maina"

Age = 30

what_i_am_learning = "Python"

2. Add two numbers and display the result:

number1 = 50

number2 = 100

Sum = number1 + number2

Print(Sum)

3. Compare if number1 is less than or equal to number2.

Improved Python Code:

name = "moses maina"

age = 30

what_i_am_learning = "Python"

number1 = 50

number2 = 100

total = number1 + number2

print("The sum is:", total)


# Comparison

print("Is number1 less than or equal to number2?", number1 <= number2)

You might also like