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

Session Handout-2

This document outlines Lab 1 for a Python programming course, detailing tasks related to string manipulation, conditional statements, and basic Python functions. It includes various code snippets demonstrating string slicing, conditionals for comparing values, and checking for even or odd numbers. The lab aims to enhance students' skills in writing, testing, and debugging simple Python programs.

Uploaded by

fewade2243
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)
2 views3 pages

Session Handout-2

This document outlines Lab 1 for a Python programming course, detailing tasks related to string manipulation, conditional statements, and basic Python functions. It includes various code snippets demonstrating string slicing, conditionals for comparing values, and checking for even or odd numbers. The lab aims to enhance students' skills in writing, testing, and debugging simple Python programs.

Uploaded by

fewade2243
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/ 3

FACULTY OF TECHNOLOGY

Information & Communication


Technology
Subject: PWP -01CT1309

Lab 1
Name : Jefin Date:06/07/22
Enrollment No: 92100133013

CO1: To write, test, and debug simple Python programs


CO2: To implement Python programs with conditional, loops and functions

Task1:
Python Code:

#1
a="MY Department name is ICT"
a[2:13]

#2 Slicing of String
b="Hello, World!"
print(b[2:5])
print(b[:5])
print(b[2:])
print(b[::-1])
print(b[-1::])
print(b[::1])
print(b[1::])
print(b[::2])
print(b[-5:-2])
print('a' in 'program')
print('at'not in 'program')

#3
a="Department"
print(a[0:6])

#4. Conditional statement


a=6
b=5
if a>b:
print("A is greater than B")

elif a==b:
print("A is Equal to B")

else:
|1
FACULTY OF TECHNOLOGY
Information & Communication
Technology
Subject: PWP -01CT1309
print("B is greater than A")

#4. TASK ODD/EVEN


a=36

if a%2==0:
print("A is Even")
else:
print("A is ODD")

#5.TASK
a="ICT"

if 'C'in a:
print("TRUE...")
else:
print("False...")

#6 Remove Space
a=" ICT "
print(a.strip())

#Task
a="ICT"
print(2*a)

|2
FACULTY OF TECHNOLOGY
Information & Communication
Technology
Subject: PWP -01CT1309

Output:

|3

You might also like