0% found this document useful (0 votes)
7 views2 pages

Python Tutorials

This document is a guide for a Python programming practical course, outlining the objectives and content of the first lesson. It covers data types, conditional statements, and loop structures in Python. The lesson includes examples of each programming concept to aid understanding.

Uploaded by

send2wanji1
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)
7 views2 pages

Python Tutorials

This document is a guide for a Python programming practical course, outlining the objectives and content of the first lesson. It covers data types, conditional statements, and loop structures in Python. The lesson includes examples of each programming concept to aid understanding.

Uploaded by

send2wanji1
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

Python Tutorial(Practicals)

BSMMP 2.1
Tutor: Mr. Robert Maina

OVERVIEW & PURPOSE

The following is a computational mathematics I guide on the programming practicals


using Python Language.

LESSON 1: 17TH JUNE, 2022

Objectives

1. Introduction to python programming(data types, conditional statements, loops


and functions)
2. Installation of relevant software.

Introduction

1. Data Types

Text Type: str

Numeric Types: int, float, complex

Sequence Types: list, tuple, range

Mapping Type: dict

Set Types: set, frozenset

Boolean Type: bool

Binary Types:bytes, bytearray, memoryview

None Type: NoneType

1
2. Conditional Statements

a = 200

b = 33

if b > a:

print("b is greater than a")

elif a == b:

print("a and b are equal")

else:

print("a is greater than b")

3. Loops

Python has two primitive loop commands:

a) while loops

i = 1

while i < 6:

print(i)

i += 1

else:

print("i is no longer less than 6")

b) for loops

fruits = ["apple", "banana", "cherry"]

for x in fruits:

print(x)

if x == "banana":

You might also like