Progress While Learning Essay

4088 words - 17 pages

4. More Control Flow Tools
Besides the while statement just introduced, Python knows the usual control flow statements known from other languages, with some twists.
4.1. if Statements
Perhaps the most well-known statement type is the if statement. For example:
>>> x = int(input("Please enter an integer: "))
Please enter an integer: 42
>>> if x < 0:
... x = 0
... print('Negative changed to zero')
... elif x == 0:
... print('Zero')
... elif x == 1:
... print('Single')
... else:
... print('More')
There can be zero or more elif parts, and the else part is optional. The keyword ‘elif‘ is short ...view middle of the document...

... if len(w) > 6:
... words.insert(0, w)
>>> words
['defenestrate', 'cat', 'window', 'defenestrate']
4.3. The range() Function
If you do need to iterate over a sequence of numbers, the built-in function range() comes in handy. It generates arithmetic progressions:
>>> for i in range(5):
... print(i)
The given end point is never part of the generated sequence; range(10) generates 10 values, the legal indices for items of a sequence of length 10. It is possible to let the range start at another number, or to specify a different increment (even negative; sometimes this is called the ‘step’):
range(5, 10)
5 through 9
range(0, 10, 3)
0, 3, 6, 9
range(-10, -100, -30)
-10, -40, -70
To iterate over the indices of a sequence, you can combine range() and len() as follows:
>>> a = ['Mary', 'had', 'a', 'little', 'lamb']
>>> for i in range(len(a)):
... print(i, a[i])
0 Mary
1 had
2 a
3 little
4 lamb
In most such cases, however, it is convenient to use the enumerate() function, see Looping Techniques.
A strange thing happens if you just print a range:
>>> print(range(10))
range(0, 10)
In many ways the object returned by range() behaves as if it is a list, but in fact it isn’t. It is an object which returns the successive items of the desired sequence when you iterate over it, but it doesn’t really make the list, thus saving space.
We say such an object is iterable, that is, suitable as a target for functions and constructs that expect something from which they can obtain successive items until the supply is exhausted. We have seen that the for statement is such an iterator. The function list() is another; it creates lists from iterables:
>>> list(range(5))
[0, 1, 2, 3, 4]
Later we will see more functions that return iterables and take iterables as argument.
4.4. break and continue Statements, and else Clauses on Loops
The break statement, like in C, breaks out of the smallest enclosing for or while loop.
Loop statements may have an else clause; it is executed when the loop terminates through exhaustion of the list (with for) or when the condition becomes false (with while), but not when the loop is terminated by a break statement. This is exemplified by the following loop, which searches for prime numbers:
>>> for n in range(2, 10):
... for x in range(2, n):
... if n % x == 0:
... print(n, 'equals', x, '*', n//x)
... break
... else:
... # loop fell through without finding a factor
... print(n, 'is a prime number')
2 is a prime number
3 is a prime number
4 equals 2 * 2
5 is a prime number
6 equals 2 * 3
7 is a prime number
8 equals 2 * 4
9 equals 3 * 3
(Yes, this is the correct code. Look closely:...

Other Essays Like progress while learning

Professional Learning Communities Essay

1607 words - 7 pages The role of schools is student learning. A significant factor in whether students learn well is the ability and quality of the teachers. Quality is improved through continuous professional development. The framework most supportive of the learning of professionals is professional learning communities (PLC) (Hord, 2009). Forming PLC is a process of focusing on student achievement while empowering educators with the skill set to make a

Appropriate Classroom Essay

615 words - 3 pages , investigate, observe and experiment, while allowing for appropriate risk taking within safe boundaries. In a developmentally appropriate classroom, assessment of young children is ongoing, authentic, and purposeful. Observational assessment shows children’s progress over time, while work samples and documentation of students’ work help to guide the curriculum plan. Teachers adapt instruction to the developmental needs and learning styles of the students

Communication and Decision Making

1085 words - 5 pages businesses, including: Setting enterprise wide initiative criteria, determining the enterprise wide priority initiatives, Determining and confirming investment allocation on a project basis, monitoring progress and spending. The second group is The Learning Management Council was established to help guide the next phase of IBM’s learning transformation and to provide the guidance and controls necessary to implement the strategic learning plans and

The Importance of Brain-Based Learning

2311 words - 10 pages of The first advantage of this form of learning is that it “engages the whole body and mind.” With brain-based learning, a child actively learns rather then sitting passively for hours in a classroom. Instead of assessing a child's progress based on their homework and/or test scores, brain based learning incorporates student demonstrations and portfolios of their writings and artwork to track the progress they have made. Brain based learning

The Role of the Teacher in Planning and Organisation

1552 words - 7 pages authorities often advocate teachers produce linear, formulaic lesson plans and student progress plans, in which pre-ordained objectives for children’s learning are dominant (Bage, Grosvernor and Williams 1999, 50). Teachers need to allow for flexibility in their planning, so they can respond to the children’s interests and any unpredicted learning needs presenting during the lesson. How an individual teacher plans and responds to pupils during a

Pel Theory Assessment Level 4

3807 words - 16 pages find out about preferred learning style? - Does it analyse the person against the skills they require to study, learn, work or progress to higher education? The final vital point of negotiating with learners is planning and negotiating learning goals. A learning goal is what learners want to achieve by attending the course presented by the teacher. Wilson (2009) refers to goals as building blocks of progression she states ‘ they aim to

How Environment Plays a Role in Learning

1781 words - 8 pages all physical facets such as teaching materials, classrooms and learning facilities, inside and also outside of the classroom structure. While the psychosocial component is associated with the interaction between students and students, students and teachers and students and their environment (as cited in Amirul et al., 2013, para. 2). Together these two components work hand in hand determining the learning environment and influencing the learning

Assignment 1 Learning Coach

2861 words - 12 pages direction. The third element is wider learning consisting of skills, knowledge, understanding, values and experiences that all 14-19 year olds will need whatever their learning pathway. There are also three elements of support for the learner. Each learner is entitled to a Learning Coach. The learner has an entitlement to learning support, opportunity to discuss learning and progress on a regular basis. The learner is also entitled to

Assignment 305 Teacher Training

1036 words - 5 pages requirements or learning difficulties. For example, whether they are dyslexic or have a hearing impairment. This is very important as it will allow you to prepare teaching activities and resources to cater for individual learner needs. Throughout the course you will use formative assessment. Formative assessment is used to determine progress and understanding. You can use informal questioning, worksheets and tasks to formatively assess. Formative

Impacting Organizational Learning - the Training and Experiences of Quality Award Examiners and Assessors

3664 words - 15 pages . Self-assessment improves not only operational processes but also managerial and strategic processes. The ultimate aim of self-assessment is to identify areas for improvement and initiate action to incorporate these changes while being strategically aware of the business environment and becoming more proactive in regard to that environment. In this regard self-assessment has an impact on organizational learning particularly that of double loop

Reflective Essay in Mentorship

2366 words - 10 pages development plan and my own learning by answering their questions. As a registered nurse my duties are mainly focused on attending the patients. Due to the busy nature of the ward it is essential to have a proper lesson plan while I undertaking a student to support in addition to the normal duties. Reece and Walker (2000) support this idea by telling that lesson plan is intended to help teachers logically. when I think about teaching students I looked

Related Papers

Roles, Responsibilities And Boundaries As A Teacher In Terms Of The Teaching/Training Cycle

563 words - 3 pages pupils with the information they need to then progress along a path of guided learning towards an established goal. The teaching/training cycle refers to an order of assessment that the tutor should go through while teaching a student that leads to training plans for the student and then review of their progress. It is the teacher’s responsibility to give the student feedback throughout. This learning process and prompt them to reflect on their

A1 Award Unit 1 Essay

843 words - 4 pages own learning and academic progress. Formative assessments are commonly contrasted with summative assessments which are used to evaluate student learning progress and achievement at the conclusion of a specific instructional period usually at the end of a unit, course, or program. Formative assessments are for showing learning, while summative assessments are of learning. It should be noted, however, that the distinction between formative and

The Importance Of Establishing A Safe And Supportive Learning Environment

538 words - 3 pages : • The physiological need: Is the learning environment comfortable? Am I hungry, thirsty, tired, cold? • Safety/security: Am I at danger while learning? Am I worried about anything? • Recognition: Do I belong here, do others respect me? • Self-esteem: Am I learning something useful? • Self actualization: I am achieving what I wanted to When students satisfy their needs at one level, they should be able to progress to the next. Something may set

Facilitate Learning And Development Activities To Meet An Individuals Needs

939 words - 4 pages made activity may be more beneficial to an individual as the activity will be designed to suit the individual's needs. For example an activity for somebody with a learning difficulty may be more beneficial to them if it was made to suit their needs if the activity is related to skills development. Another example would be if an individual could not walk for very long or complete any physical activities for a while you might find that tailoring