Python IT Report
Python IT Report
September 2023
i
ABSTRACT
This report describes my experience during my industrial training period. It’s centered on
INFOTECH LTD., An I.T. training firm specialized in training people in line with the world
standard. The industrial training scheme was introduced as a mandatory measure by the
Federal government to enhance the quality of graduates produced by the tertiary institution of
Nigeria. The scheme is essential in the development of the practical and professional skills
required of each student by their respective course of study and also stands as an aid to
prospective employment. Under the scheme students are expected to spend time in any
company that provides them the opportunity to acquire technical skills and experience. This
report describes the experience gained, challenges faced, skills acquired and observations
ii
DEDICATION
This SIWES report is dedicated to my parents, Mr. Azeez Saheed and Mrs. Muftau Idayat
iii
ACKNOWLEDGEMENT
I give glory to God Almighty for bestowing his protection, good health, and
strength on me from the beginning of my SIWES program to the end and for the opportunity
There are numerous people to appreciate but few are of mentioned, I hereby send my
profound gratitude to everyone who has immensely contributed to the success of my SIWES
instructor Mr. Abioye Isaac and other instructor in the training firm for their immeasurable
Supervisor Mr. Osuoha Jude and my H.O.D. Prof. Olaniyan and all my Departmental for
their thorough supervision and useful advice which added positively to the success of the
SIWES programme.
My appreciation also goes to my beloved parent, and my extended family for giving
me the right qualitative education and for their support in kindness and finances.
Finally, I acknowledge the support of my departmental lecturer Mr. Ilesanmi for his
useful advice and patience in offering solutions when called on my I.T difficulties.
iv
CERTIFICATION
I hereby certify that this report on Student Industrial Work Experience Scheme
INFOTECH LTD.” was written and submitted by AZEEZ SAMAD AYOMIDE with
Engineering, Federal University of Oye Ekiti, Ekiti State, in partial fulfilment of the
requirement for the award of Bachelor of Engineering (B.Eng.) in Agricultural and Bio
Resources Engineering.
………………………….. ………………………………..
………………………………
HOD’s Signature
v
TABLE OF CONTENT
Abstract ii
Dedication iii
Acknowledgement iv
Certification v
Table of content vi
CHAPTER ONE
1.1 Introduction 1
1.2 Historical Development of SIWES and ITF in Nigeria 2
1.3 Objective of SIWES 3
CHAPTER TWO
2.1 About Company 4
CHAPTER THREE
3.1 Python 5
3.2 Scripting Language 5
3.3 Object Oriented programming 6
3.4 History 6-7
3.5 Downloading python 7-9
3.6 Installing python 9-11
3.7 Setup path variable 11-12
3.8 Running the python IDE 12-13
CHAPTER FOUR
4.1 Basic Syntax 14
4.2 Interactive interpreter prompt 14
4.3 Using a script file 14
4.4 Python Indentation 15
4.5 Python Comment 15-16
vi
4.6 Multiline Comment 16
CHAPTER FIVE
5.1 Python Datatypes 17-20
5.2 Variable 20-22
5.3 Python Operators 22-27
CHAPTER SIX
6.1 Input Function 29
6.2 Statement and Expression 29-30
6.3 Python List 30
6.3.1 Adding list items 31
6.3.2 Deleting list items 32
6.3.3 Looping through a list 32-33
6.3.4 Joining list 34-35
CHAPTER SEVEN
7.1 Set 35
7.1.1 Adding to a set 36
7.1.2 Remove set item 37
7.1.3 Looping set 37
7.1.4 Joining set 37-39
CHAPTER EIGHT
8.1 Dictionary 39
8.1.1 Adding dictionary items 41-42
8.1.2 Nested Dictionary 42 -43
CHAPTER NINE
9.1 Tuple 44
9.1.1 Removing items 45
9.1.2 Delete Tuple 45
9.1.3 Looping in a tuple 45
vii
9.1.4 Join tuple 46
CHAPTER TEN
10.1 Python conditional statement 46
10.1.1 Tenary Operators 48
CHAPTER ELEVEN
11.1 Loop 48
11.1.1 While loop 48
11.1.2 For loop 49
11.1.3 Break statement 49
11.1.4 Continue Statement 50
CHAPTER TWELVE
12.1 Function 50
12.1.1 Return 52
12.1.2 Arbitrary argument (*args) 52-53
12.1.3 Application of Python In Agricultural Engineering 53
12.1.4 Some Significant Technological Improvements For Agriculture 54
viii
CHAPTER ONE
Industrial Training is a compulsory skill training programme designed to expose and pre
Technology and Colleges of Agriculture, for the industrial work situation they’re likely to
knowledge in real work situation, thereby bridging the gap between university work and
actual practice while ensuring the employer’s involvement in the entire educational process
of preparing university graduates for employment in industries. The main operators in the
SIWES programme are the ITF, the coordinating agencies (NUC), employers of labour and
the tertiary institutions. It is funded by the Federal Government of Nigeria, and beneficiaries
Environmental science, Education, Medical Science and the Pure and Applied Science.
Diploma and Degree certificates in specific disciplines in most institutions of higher learning
1
1.2 Historical development of SIWES and ITF in Nigeria
The idea of the SIWES programme started in Cincinnati in USA in 1996. There was a
collaboration that evolved between the universities and industries for providing students
practical experiences. The programme basically involved students going through a form of
apprenticeship programme using the industries as an extension of the school laboratories. The
The idea was imported into Nigeria during the Second National Development Plan
between 1970 and 1974 in order to ameliorate the problem faced by graduates produced by
several institutions of learning within the country who find it difficult to render a qualitative
service in their areas of specialization for which they have been trained in their various
disciplines. The first thing the Federal Government did was to promulgate the ITF
programme through the decree NO. 47 of 1971 during the national development programme
in the post war era, to boost and develop the middle power level of the Nigerian economy.
The decree charged ITF with the basic aim of promoting and encouraging the
acquisition of skills in industry and commerce with a view to generating a pool of indigenous
The fund actually began operation not until its policy statement was introduced
alongside SIWES programme in 1973 after other thongs had been put into place such as
having staff strength of 10 persons in the professional cadre as of 1986 which has now grown
both headquarters and area offices. The staff strength of the ITF is approximately 1,400
senior and junior staff which it disburses its responsibilities in order to be able to meet
concentrations of industries and commerce. The fund has so far established area offices in 18
2
1.3 OBJECTIVE OF SIWES
The Industrial Training Fund was charged with the responsibility of promoting and
acquiring the application of basic skills in industrial and commercial fields. I.T.F has done so
much to achieve the aims of SIWES in that, it has the following aims:
1. Enhancing the industrial skill acquisition and work experience of students thus augmenting
their theoretical knowledge to make them efficient at solving the practical problems at their
2. To enable the students to understand the company operation and function thereby building
interpersonal relationships (between students and work community) and a high sense of
responsibility.
3. A governmental agency known as Industrial Trust Fund (ITF) in collaboration with the
Nigerian Universities to expose students to the practical aspects of his/her course of study.
4. To promote the desired technological know-how for the development of this nation.
5. To provide an avenue for students in institutions of higher learning to acquire industrial skills
6. To enable the students to match theoretical knowledge with the application in the industry.
7. Ensuring the involvement of the related industries and organizations in the training,
education, exposure, and development process of the students which they will in turn employ
3
CHAPTER TWO
Classic is an indigenous ICT firm registered with Corporate Affairs Commission (CAC), with
over 10 years of experience providing world class ICT training to Nigerians. Classic is
Computer Training
Data Processing
Web Development
Managerial Training
Graphics
Electronic Accounting’
Database Management
Software Engineering
Hardware Engineering.
4
CHAPTER THREE
3.1 PYTHON
programming language. Its design philosophy emphasizes code readability, and its syntax
allows programmers to express concepts in fewer lines of code than would be possible in
languages such as C++ or Java. The language provides constructs intended to enable clear
system and automatic memory management and has a large and comprehensive standard
library. Python interpreters are available for installation on many operating systems, allowing
programs written for a special run-time environment that automate the execution of tasks that
Scripting languages are often interpreted (rather than compiled). Environments that
can be automated through scripting include software applications, web pages within a web
browser, the shells of operating systems (OS), embedded systems, as well as numerous
games.
5
programming languages, as they operate at a high level of abstraction, or as control
languages.
concept of "objects", which may contain data, in the form of fields, often known as attributes;
and code, in the form of procedures, often known as methods. A distinguishing feature of
objects is that an object's procedures can access and often modify the data fields of the object
with which they are associated (objects have a notion of "this" or "self").
In OO programming, computer programs are designed by making them out of objects that
interact with one another. There is significant diversity in object-oriented programming, but
most popular languages are class-based, meaning that objects are instances of classes, which
3.4 HISTORY
Python was conceived in the late 1980s, and its implementation was started in
December 1989 by Guido van Rossum at CWI in the Netherlands as a successor to the ABC
language (itself inspired by SETL) capable of exception handling and interfacing with the
Amoeba operating system. Van Rossum is Python's principal author, and his continuing
central role in deciding the direction of Python is reflected in the title given to him by the
6
- Guido van Rossum
1996:
hackers. I chose Python as a working title for the project, being in a slightly irreverent mood (and a big fan of
If you don’t already have a copy of Python installed on your computer, you will need to open
(http://www.python.org/download/).
to download. For the purposes of this article we will use the most up to date version available
(Python 3.4.1).
Once you have clicked on that, you will be taken to a page with a description of all the new
updates and features of 3.4.1, however, you can always read that while the download is in
process. Scroll to the bottom of the page till you find the “Download” section and click on the
Now you will scroll all the way to the bottom of the page and find the “Windows x86 MSI
installer.” If you want to download the 86-64 bit MSI, feel free to do so. We believe that even
if you have a 64-bit operating system installed on your computer, the 86-bit MSI is
preferable. We say this because it will still run well and sometimes, with the 64- bit
architectures, some of the compiled binaries and Python libraries don’t work well.
8
3.6 Figure 5 operating system selection
INSTALLING PYTHON
Once you have downloaded the Python MSI, simply navigate to the download location on
your computer, double clicking the file and pressing Run when the dialog box pops up.
If you are the only person who uses your computer, simply leave the “Install for all users”
option selected. If you have multiple accounts on your PC and don’t want to
install it across all accounts, select the “Install just for me” option then press “Next.”
9
Figure 7 installation
If you want to change the install location, feel free to do so; however, it is best to leave it as is
Scroll down in the window and find the “Add Python.exe to Path” and click on the small red
“x.” Choose the “Will be installed on local hard drive” option then press “Next.”
10
Now that you have completed the installation process, click on “Finish.
Begin by opening the start menu and typing in “environment” and select the option called
Once you have the “Environment Variables” window open, direct your focus to the bottom
half. You will notice that it controls all the “System Variables” rather than just this associated
with your user. Click on “New…” to create a new variable for Python.
11
Figure 10 create a new system variable
“C:\Python27\;C:\Python27\Scripts;”
Now that we have successfully completed the installation process and added our
“Environment Variable,” you are ready to create your first basic Python script. Let’s begin by
opening Python’s GUI by pressing “Start” and typing “Python” and selecting the “IDLE
(Python GUI).”
12
Figure 12 Running python IDE
Once the GUI is open, we will begin by using the simplest directive possible. This is the
“print” directive which simply prints whatever you tell it to, into a new line. Start by typing a
print directive like the one shown in the image below or copy and paste
this text then press “Enter”: print (“Congratulations on executing your first print directive!”).
13
Python’s traditional runtime execution model: source code you type is translated to byte code,
which is then run by the Python Virtual Machine. Your code is automatically compiled, but
then it is interpreted.
CHAPTER FOUR
Python provide us the feature to execute the python statement one by one at the
interactive prompt. It is preferable in the case where we are concerned about the output of
each line.
To open the interactive mode, open the terminal (or command prompt) and type
python (python3 in case if you have both python2 and python3 installed on your system). It
14
will open the prompt where we can execute the python statement and check its impact on the
console.
Python3 provides print () function to print some message on the console. We can pass
message as a string into this function. Here we get the message “hello World!” printed on the
console.
Interpreter prompt is good to run the individual statements of code. However, we can not
write the code every-time on the terminal. We need to write our code into a file which can be
executed later. For this purpose, open an editor like notepad, create a file named first.py
(python used .py extension) and write the following code in it.
Print (“Hello World”); #here, we have used print() function to print the message on the
console. To run the file named as first.py, we need to run the following command on the
terminal
Indentation refers to the spaces at the beginning of a code line, where in other programming
languages the indentation is for readability only, the indentation in Python is very important.
Example:
if 5 > 2:
print("Five is greater than two!")
Python will give error if you skip the indentation
if 5 > 2:
print("Five is greater than two!") #syntax error
15
You have to use the same number of spaces in the same block of code, otherwise python will
if 5 > 2:
print("Five is greater than two!")
print("Five is greater than
two!") #syntax error
Creating a comment
Example:
#This is a comment
print("Hello, World!")
Comments can be placed at the end of a line and python will ignore the rest of the line.
Example:
A comment does not have to be text that explains the code, it can also be used to prevent
#print("Hello, World!")
print("Cheers, Mate!")
Python does not really have a syntax for multi-line comments. To add a multiline comment
16
#This is a comment
#written in
# more than just one line
print("Hello, World!")
Or you can use a multiline string, since Python will ignore string Literals that are not
assigned to a variable, you can add a multiline string (triple quotes) in your code, and place
"""
This is a comment
written in
more than one line
"""
print("Hello, World!")
CHAPTER FIVE
A data type is a value and they are the core to the programming language. In programming
language, data type is an important concept, variable can store different data types and
Python has the following data types built-in by default, in these categories:
17
None types none
Table 1Datatypes
Numeric Types
int: This is used for integers and these are numbers that do not contain decimal points for
example 2, 6, 8, etc.
floats: The floats represent floating points numbers and these are numbers that contains
decimal places. Examples are 3.14, 0.25, 0.75 etc. and any thing that has decimal point.
complex: This represent numbers with real and imaginary factors. Examples; 2+5x, 2-3x.
Sequence Types
The list: this represent an order collection of items enclosed in square bracket ([]) such as [1,
parenthesis (1, 2, 3, 4, 5)
Mapping Type
enclosed in curly bracket ({}), such as: X = { “name” : “John”, “age” : 36}.
Set Type
Set represents an ordered collection of unique items enclosed in curly braces such as {1, 2, 3}
18
print(type(x)) print(type(d))
print(type(y)) print(type(e))
print(type(z)) print(type(f))
Frozenset: this represent an immutable set enclosed in parenthesis such as ({1, 2, 3, 4})
Boolean Type
None type: This represent the absence of a value often used to indicate a null or empty value.
Examples:
Dictionary = {
"lastname" : "Doe",
"firstname" : "John",
"age" : 29,
"city" : "Lagos"
}
print(Dictionary)
19
Other examples are:
x = True bool
print(x)
print(type(x))
5.2 VARIABLE
A variable is a container, which stores value. e.g. x = 5 (where the x is the variable).
A variable does not need to be declared with any particular type and the type can also be
Example:
lastname = "guide"
age = 14
fruit = ("orange", "mango", "pineapple")#this variable carry a
particular datatype or value
20
Naming Variable
Variable names can be a group of both letters and digits, but they have to begin with a letter
A variable can have a short name like x, y, and can also have a more descriptive name like
All the characters except the first character may be an alphabet of lower-case (a-z),
variable name must not contain any white-space, or special character (! @, #, %, ^, &,
*).
variable name must not be similar to any keyword defined in the language.
variable name are case sensitive for example; my name, and MyName is not the same.
Variables that contain multi-words can be declared using several techniques to make them
more readable.
Camel case – each word start with a capital letter except the first one e.g. ageJohn = 29,
myNewState = “Lagos”
# data type - integer
ageJohn = 29
print(ageJohn)
print(type(age))
Pascal case – Each words start with a capital letter e.g. LastName = “George”
21
print(LastName)
print(type(LastName))
Snake case - Each word is separated by an underscore. E.g. theother_name = “Cain”
Python allow us to assign a value to multiple variables in a single statement which is also
We can apply multiple assignments in two ways either by assigning a single value to multiple
Examples:
The operator can be defined as a symbol which is responsible for a particular operation
between operands.
22
Arithmetic operators are used for mathematical calculations and includes; addition,
Assignment Operators
They are the operators that are used to assign value to the variables. They combined their
assignment operation with another operation making it more concise to update the value.
23
right from the variable print(a)
current value and assign the
result back to the variable
*= multiplication Multiply the variable current a *= 5
assignment value by the right value and print(a)
assign the result back to the
variable
/= division assignment Divides the variable current a /= 5
value by the value on the print(a)
right and assign the result
back to the variable.
** exponential assignment Raises the variable current a **= 5
value to the power of the print(a)
value on the right and
assigns the result back to the
variable
%= modulo assignment It performs modulo a += 5
operation with the variable print(a)
current value and value on
the right then assign the
result back to the variable
//= floor division assignment It performs floor division a += 5
with the variable current print(a)
value and value on the right
then assign the result back to
the variable
Comparison operators: they are used to compare two values. They return a Boolean value
24
> This checks if the left value print(c > d)#true
is greater than the right
value
< Checks if the left value is print(c > d)#false
less than the right value
== Checks if the two values are print(c == d)#false
equal
!= Checks if the two values are print(c != d)#true
not equal
>= The greater than or equal to print(c >= d)#true
checks if the value on the
left is greater than or equal
to the right value and the
<= The less than or equal to print(c <= d)#false
checks if the value on the
left is less than or equal to
the right value and the
Logical Operators
These are used to combine and manipulate boolean values. Logical operators are used to
and: the ‘and’ operator returns true, if both left and right expression are true: otherwise is
returned false.
or: the or operator return true if one of the left or right expression is true. If both expressions
not: the not operator negates the true – false of an expression, it returns true when an
Example:
25
x = 5
y = 10
z = 3
a = (x<y) and (z<y)#true
b = (x<y) and (y<z)#false
c = (x<y) or (z<x)#true
d = (x<y) or (y<z)#true
e = (x>y) or (y<z)#false
Python identity operators are used to compare the objects , not if they are equal but if they are
26
x = ["orange", "mango", "pinapple"]
y = ["orange", "apple", "mango"]
print("apple" in x)
print("mango" in x)
print("apple" not in x)
print("mango" not in x)
Python casting is used to specify the type of data on a variable. We can call it type
a = 2.4
b = 12
c = "Hello"
d = int(a)
e = float(b)
c = int(c)
print(type(a))
print(type(b))
5.5 STRING
27
for x in fruit:
print(x)
String Length
print(len(fruit))
print(len(About_Ade))
Check String
String Modification
Strip method: this removes the width space from the beginning to the end
Split method: this returns a list where the text between the specified separator becomes a
28
Format String
We use the format method to format string and we have to place the curly brace ({}) into the
string to be formatted.
ageJude = 39
stJude = "Jude is {}years old"
print(stJude.format(ageJude))
The input function is used to prompt the user for input from the keyboard. It also allows you
to interact with the user and obtain data during the execution of a program. The input() takes
an optional string argument known as “PROMPT” which is displayed to the user before
waiting for the input. the user can then type their response and presenter. The input() reads
keywords, operators, variables and other elements that produce a specific effect. Statement
statement).
29
x = 9#variable assignment
print("Hello")#function call statement
if y>x:#conditional statement
print("hello Y")
Expression is a collaboration of values, variables, operators and functions call that evaluates
a value. Expression can be simple or complex and they produce a value as a result.
value.
Example of expression includes Arithmetic operations, function call, logical operation like
x = 8 + 9 #arithmetic expression
y = math.sqrt((a)) #function call expression
is_positive = x > 0 #comparision expression
result = (x + y)*2 #complex expression
In python, a list is a versatile and notable data structure that can hold an ordered collection of
items. List are denoted by [] (square bracket) and the items within the list are separated by
Example:
Range Of Index
30
We can use the range of index to specify where to start and end the range.
print(cars[1:4])
print(cars[:4])
#change of items in the list
cars[1:4] = ["Hyundai", "Ford", "Lexux"]
Insert Items
To insert a new list items without replacing any of the existing value, you can use the insert()
cars.insert(2,"Honda")
print(cars)
Append() method: the append() method is used to ass an item to the end of the list.
cars.append("kia")
print(cars)
cars.remove("Benz")
31
Pop() method: the pop() method removes the specified items. It also removes the last
cars.pop(3)
print(cars)
del cars[5]
print(cars)
The Clear Method: this empty the list unlike the del. The list remains but has no content.
cars.clear()
print(cars)
#result = []
We can loop through the list items by referring to their index numbers, we use the range, len
32
Using a while loop : you can loop through the list items by using a WHILE loop. Use len()
function to determine the length of the list and start at 0 and loop your way to the list by
referring to their indexes. Remember to increase the index by 1 after each iteration.
Sorting List: to sort through list items, we use sort method Sort().
Copying List
You cannot copy a listby simply typing list 2 = list 1 because list 2 will only be referenced to
list one and changes made in list 1 will automatically be made in list 2.
33
list1 = ["apple", "onions", "mango", "banana"]
list2 = list1.copy()
print(list2)
The easiest way to join list is using the + operator for concatenation.
Another way to join lists is by appending all the items form one list to another one by one.
The extend method can be use where the purpose is to add elements from one list to another.
Range Of Index
print(range(1, 100))
print(list(range(1, 100)))
fruits = ["orange", "mango", "apple", "banana", "pineapple",
"cherry", "strawberry", "lemon", "guava"]
print(len(fruits))
34
print(fruits[-1]) # negative effects (just one)
print(fruits[1::])# printed all
print(fruits[:5])# print orange - pineapple
While Listing
num = list(range(1,101))
i = 0
while i < len(num):
print(i)
i = i + 2
7.1 SET
Set is an unordered collection of unique elements. It is a built-in data structure that provide
several methods for performing set operations, such as union, intersection, difference and
more.
Set is used to store multiple items in a variable. Set is unordered and unindexed, set items are
unchangeable and do not allow duplicate value. once set is created, you cannot change its
Creating a set
35
You can create a set by enclosing comma separated elements within a curly bracket or by
num1.add(8)
print(8)
Update method: it is used to add items from another into the current set.
num1.update(num2)
print(num1)
num1.update(fruits)
print(num1)
To remove set items, you can either make use if remove or the discard method.
num1.remove(2)
num1.discard("banana")
print(num1)
Pop Method: the pop method delete the last element in the set
36
y = num1.pop()
print(y)
print(num1)
num1.clear()
print(num1)
Delete method: it delete the set completely
del.num1
print(num1)
Union():
37
Intersection_Update: the intersection_update() keeps only the items that are present in both
sets.
Intersection: the intersection() method will return a new set, that contains only the items
fruits.intersection_update(phones)
print(fruits)
intersect = fruits.intersection(phones)
print(intersect) #apple
elements that are not present in both sets. (opposite of the intersection_update).
Symmetric_difference: it will return a new set, that contains only the elements that are not
fruits.symmetric_difference_update(phones)
print(fruits)
fruits.symmetric_difference(phones)
print(fruits)
num = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}
numbers = num.copy()
print(numbers)
38
z = super.intersection(sub2)
print(z)
The Superset()
This return ‘True’ when the super set contains another set.
p =super.issuperset(sub1)
q = super.issuperset(sub2)
print(p)
print(q)
8.1 DICTIONARY
person = {
"lastname": "Doe",
"firstname": "John",
"age": 39,
'isEmployed': True,
}
print(person)
print(type(person))
39
age1 = person["age"]
print(age1)
Get() Method
person_age = person.get("age")
print(person_age)
x = person.keys()
print(x)
Get values(): this returns the list of all values in the dictionary.
y = person.values()
print(y)
Items(): this method will return each items in the dictionary as tuple in a list.
person[age] = 40
age = person[age]
print(age)
print(person)
Update(): this update dictionary with items from a given argument. The argument must be a
person.update({"lastname": "Wood"})
print(person)
40
person.update({"is married": True})
print(person)
person2 = {
"lastname": "King",
"firstname": "Joshua",
"age": 28
'isMarried': True,
}
for x in person2:
print(x)
for x in person2:
print(person2[x])
for x in person2.keys():
print(x)
for x in person2.values:
print(x)
for x, y in person2.items():
print(x, y)
Copy in dictionary
theperson = person2.copy()
print(theperson)
dict()
second_person = dict(person2)
print(second_person)
firstperson = dict(person)
print(person)
41
Family = {
"Father":{
"lastname": "Oladele",
"firstname": "Matthew",
"age": 47,
},
"Mother":{
"lastname": "Oladele",
"firstname": "Mary",
"age": 45,
},
"Child":{
"lastname": "Oladele",
"firstname": "Esther",
"age": 23,
}
}
print(Family)
mutd = {
"keeper": "Onana",
"defenders": ["Shaw", "Maguire", "Dalot", "Varane"],
"midfielders": ["Bruno", "Caseming", "Mount"],
"attackers": ["Sancho", "Rashford", "Rasmud"],
}
mcty = {
"keeper": "Ederson",
"defenders": ["Stones", "Laporte", "Ake", "Akanji"],
"midfielders": ["Kelvin", "Rodri", "Foden"],
"attackers": ["Jack", "Haaland", "Silva"]
}
manchester ={
"mutd" :mutd,
"mcty" :mcty,
42
}
print(manchester)
print(mutd["defenders"])
print(mutd["defenders"][1])
Pop Method
mutd.pop("attackers")
print(mutd)
attackers = mutd.pop("attackers")
9.1 TUPLES
items in a single variable. A tuple is a collection which is ordered and unchangeable. Tuple
is one of the four built-in datatype in python used to store collection of data.
43
print(cars[-1])
print(cars[-1:-6:-2])
Updating Tuple
Tuples are unchangeable, meaning you cannot change, add or remove items once the tuple is
y = list(cars)
y.remove(("Acura"))
cars = tuple(y)
print(cars)
del(cars)
print(cars)
44
9.1.3 LOOPING IN A TUPLE
# for looping
for x in range(len(cars)):
print(cars[x])
#while looping
i = 0
while i < len(cars):
print(cars[i])
i = i + 1
We can make use of concatenation(+) and the multiplication sign(*) to manipulate tuple.
In python, conditional structures are used to make decision in your code. The most common
“if” statement is the fundamental control statement that allows you to make decision in your
code based on certain. It enables you to execute a block of code put into the conditional
# if statement syntax
if condition:
code to be executed if the condition is true:
x = 7
if x > 5:
45
print("x is greater than 5")
age = 12
Python “else” is another control statement that can be used in conjunction with the”if”
statement. It also specifies a block of code to be executed when the condition of the “if”
46
elif score <= 100:
print("Promote")
elif score > 100:
print("Out of grading")
print(result)
z = 10
result = "z is an even number" if z % 2 == 0 else "z is an odd
number"
print(result)
11..1 LOOP
A loop in programming is a control statement that allows you to execute a block of code
repeatedly. It is used when you want to perform the syntax or a series of task multiple times.
While loop
For loop
47
code to run
the loop will continue so far the condition is true.
n = 0
while n < 21:
print(n)
n += 1
A for loop is used for iterating over a sequence (i.e. a list, tuple, dictionary, set or string).
With the for loop, we can execute a set of statements, one for each item in a sequence.
With the break statement, we can stop the loop before it has looped through all the items.
48
break
print(x)
The continue statement stop the current iteration of the loop and continue with the next
12.1 FUNCTION
A function is a block of code which runs only when it is called. You can pass data known as
A function can return data as a result. A function is a block of organized, reuseable code that
It takes input i.e. argument, process that input, and then returns a result. Function are
modular, making it easier to break down complex tasks into a smaller manageable part.
Creating a function
49
In python, a function is defined using the “def” keyword.
# FUNCTION
def funct(): # creating a function
print("this is for python function") # code to run
funct() # calling a function
The parameters: These are input values that the function may receive.
The return keyword: this keyword id used to specify what value the function should send
def name(lname):
print("my last name is " + lname)
name('Ojo')
name('Adewale')
name('Bamisaye')
50
print(letter[::-1])
print(letter[2:7])
reverse_string()
12.1.1 RETURN
Python return statement is a special statement that is used to end the execution of a function
and send back a value to the caller. The return can be any python object such as number,
The *args syntax in python is used to pass a variable number of arguments to a function. It is
a special type of parameter that can be used to pass any number of argument to a function
regardless of how many arguments the function was originally defined to take.
The *args parameter is a tuple which means that all of the argument pass to the function are
stored as tuple.
# *args
def sum_all(*args):
total = 0
for number in args:
51
total += number
return total
x = sum_all(2,3, 4)
y = sum_all(7, 9, 14, 22, 8, 9, 15)
print(x)
print(y)
Agriculture has been around, in some form or another, forever. In the form we
know it today, agriculture has been around for over 12,000 years. Amazing, isn’t it? So, how
could this ancient field be improved and taken to a whole new level?.
How can we boost the results of various agriculture processes and improve the lives of those
who dedicate their time to farming, seeding and growing the food and supplements we all
need? Well, the answer is quite simple and there are hundreds of people creating and
developing new creative and innovative solutions for this field: Coding.
Not so long ago a new field in technology was funded, we are talking about Agritech. The
concept “Agritech” is a mix of the words Agriculture and Technology; and understanding the
principle that every field or industry can be improved with innovative and digital thinking,
52
12.1.4 SOME SIGNIFICANT TECHNOLOGICAL IMPROVEMENTS FOR
AGRICULTURE
Every positive change is the result of a long process of observation and the application of a
vast skill set such as innovation, analytical thinking, creativity and teamwork (because most
successful projects aren’t done in solo-mode). By observing the challenges agriculture has
had for thousands of decades, many praiseworthy ideas have appeared to significantly
Drip Irrigation
Drip irrigation is a type of micro-irrigation system, originally developed in Israel, that has the
potential to save water and nutrients by allowing water to drip slowly and directly into the
roots of plants, either from above the soil surface or buried below the surface. The goal is to
place water directly into the root zone and minimize evaporation, saving tons of water usage
every day.
These robots can automate several agricultural processes. They can make harvesting, soil
maintenance, weeding, planting, and even fruit picking way easier by creating smart
This might feel like we are already in the future, and somehow, we are. Thanks to images
delivered by satellites and smart sensors inside the soil, farmers can now better understand
what’s going on with their crop variability, weather data according to their location, etc.
This can allow them not only to make better decisions but also to optimize returns on inputs
AGRICULTURE
53
Israel is leading the way when we discuss technology for agriculture. Maybe it is because
Israelis had to make the desert flourish, or maybe it is because of their well-earned name, the
“Startup Nation”, but for some reason or another, this little Middle Eastern country is
CONCLUSION
54
In a nutshell, this SIWES industrial training done on python has been an excellent and
rewarding experience. I can conclude that there have been a lot I’ve learnt from my work at
Classic Infotech. Needless to say,the basics aspects I have learnt are not sufficient but could
As someone with no prior experience with programming whatsoever I believe my time spent
in learning python was well worth it and exposed me to finding more acceptable solutions to
improving agriculture as an agriculture engineer in making. The three main things that I have
learning.
REFERENCES
55
https://towardsdatascience.com/python-for-data-engineers
https://tekkieuni.com//coding -and-agriculture/
Training Notebook
www.python.org
Think Python
56