Introduction to Arrays

Slides:



Advertisements
Similar presentations
Count nouns one bananas Two bananas Four bananas.
Advertisements

Hungry Giant: What food do you like? There is/There are …
SomeAnyNo. Contents Some. The Rule Some. The Rule Any. The Rule Any. The Rule No. The Rule No. The Rule Exercise 1 Exercise 1 Exercise 2 Exercise 2.
Chapter 6 Lists and Dictionaries CSC1310 Fall 2009.
Do you like to go shopping Задание 1. Brainstorming Name foods that are sold in different kinds of shops.
* What food would you have with you on a picnic?
FOOD.
ON It’s an apple. ICE-CREAM HAMBURGER SOUP APPLE TEA BUTTER FRENCH FRIES CAKE JUICE BREAD SWEETS.
English Cousine. The Sunday roast The Sunday roast was the most popular feature of English cooking. As people had a six-day working week it was the time.
Containers made by Gönczi Zsófia. Are these words countable or uncountable? There is some…
Food and drinks Food and drinks. Let's train our tongues: Let's train our tongues: [i:] – sweet, tea, meat, cheese, beef [i:] – sweet, tea, meat, cheese,
COMPUTER SCIENCE FEBRUARY 2011 Lists in Python. Introduction to Lists Lists (aka arrays): an ordered set of elements  A compound data type, like strings.
Match the picture and the words. Write what you need to make toast. Put the sentences into a right order. White a minute. It’s ready. Put it in the toaster.
执教者 陈君. draw eat drink Let’s chant : Milk, milk, drink some milk. Juice, juice, drink some juice. Tea, tea, drink some tea. Coffee, coffee, drink some.
Food and drink.
Productive Resources for Making Apple Pie Images from Discoveryhttp://school.discoveryeducation.com/clipart/
SHIFTING THE BALANCE January 2004 © British Nutrition Foundation 2004.
British have a sweet-tooth… What does it mean ? Is it time to have tea, a place for sweets or something else ?
bpotatoefp fiitbcqafo eeejuicevu lqirnxozby aggpszfsgc mxteavfish yjsidjexui oadugledip emjyhowcls onatlygvrf.
Much cheese much butter much meat much bread. much milk much sausage much salad much fruits.
REMY’S RESTAURANT. [u:] juice, soup, blue [i:] eat, meat, tea [e] bread, breakfast [о] coffee, porridge [ai] ice, ice-cream [i] milk, fish, chips, drink,pizza.
МБОУ « ООШ № 17» г.Анжеро-Судженск.  I like honey on my bread, I like salad, I like eggs. I drink water all day long. All these things make me strong.
Next Some / Any Next Are there ( - ) eggs in the fridge ? anysome Yes there are ( – ) eggs No there aren’t ( – ) eggs someany some Does Rula have ( –
“Typical English food”
Lists. The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets.
f r u i t s o r a n g e p o t a t o d r i n k Divide into groups: Milk, cheese, juice, sweets, orange, potatoes, chicken, cucumber, butter, cherry,
 Did you go to the shop yesterday?  Can you bay a loaf of bread in the shop?  What bread do you prefer, black or white one?  Do you have a cup of.
Much/many/little/few
In my lunch box Spotlight 3, module 6a.
Intro to Arrays COMPUTER GAME DESIGN FAIRPORT HIGH SCHOOL.
МОУ Култаевская средняя общеобразовательная школа Работу выполнила Серая Людмила Николаевна учитель английского языка Пермский район, 2007 год Продукты.
Read Go School Together Three Please Count Visit Meet Play Dance A lot of Write Honey Jam.
HOW ARE MEALS CREATED CREATING A BALACED BREAKFAST THIS BREAKFAST IS GREAT FOR BOTH YOUNG AND OLD THIS BREAKFAST IS GREAT FOR BOTH YOUNG AND OLD A YOUNG.
1 There are no apples. There aren’t any apples. There is an apple. There is one apple. There are a few apples. There are some apples. There are many apples.
GOOD MORNING.  Today’s lesson: Create emotion:
©isagms80 Good morning ! I'm hungry ! What's for breakfast ? Listen and repeat.
Good morning! run swimhave breakfast read I usually … in the morning. jumpskip.
orange lemon banana tomato carrot sweet Fruit/ Vegetable apple potatoes orange tomato cabbagecucumber banana lemoncarrot.
Magic 8 ball. "Design and write a python program that emulates a Magic Eight Ball. Your program should continually prompt the user to enter a question.
CZECH FOOD. BREAKFAST I have always bread with butter and cheese or ham and tea. I have usually cereal and milk. I have often roll and butter and tea.
FOOD & DRINKS. A cup of Coffee Bananas A spoon of Jam.
FOOD Подготовила Шкаликова Татьяна Валерьевна
Primary Longman Elect 3A Chapter 3 Quantifiers for food and drinks.
Read the poem Some of us like brown bread Some of us like white. Some of us eat a lot of meat, Some don’t think it’s right. Some of us like apples, Some.
FOOD.
I Need Food.
Исчисляемые и неисчисляемые существительные
Interfacing with a database
Abstract Data Types (ADT)
Countable nouns one bananas Two bananas Four bananas.
WHAT IS THERE in the fridge/on the table/ in the cupboard?
Count nouns one bananas Two bananas Four bananas.
Lists in Python.
FOOD.
My favourite food.
Python: Array Slicing Damian Gordon.
SOME - ANY There are some eggs in fridge
Food & Drink Сафина Роза Сибагатовна учитель английского языка Бу «колледж-интерна т циодс» г. Ханты-мансийск.
to bring up to speak in English very well
Abstract Data Types (ADT)
FOOD & DRINKS ON.
Breakfast Vocabulary.
Count nouns one bananas Two bananas Four bananas.
Introduction to Programming with Python
And now for something completely different . . .
2-Dimensional Lists (Matrices) in Python
Emma wants to cook dinner for her mum. It is her birthday today
For loop Using lists.
London.
Lists basics A container is a construct used to group related values together and contains references to other objects instead of data. A list is a container.
Presentation transcript:

Introduction to Arrays

Arrays are: Array: This is often referred to as a list, for example, a shopping list: shopping_list = [‘milk’, ‘eggs’, ‘butter’] 2D Array: This is lists within a list, shopping_list = [[‘milk’, ‘eggs’, ‘butter’], [‘pie’, ‘cakes’, ‘biscuits’], [‘tea’, coffee’]] This type of Array is sometimes called Matrices or a Matrix

Lists numbering or indexing starts at ZERO Arrays Python A_list = [ ] (This is empty) A_list = [“a”, “b”, “c”] (A list with three entries) shopping_list = [“eggs”, “bread”, “juice”] To print the array: print (shopping_list) To print the first item in the array: print (shopping_list[0]) Lists numbering or indexing starts at ZERO Note that the first item in the array / list is in positon 0

Find the length of Arrays shopping_list = [“eggs”, “bread”, “juice”, “Butter”] To return the length of the array, how many entries there are: print (len(shopping_list)) Task Add another few items to the shopping list and check the length Explain what the len() function does, finds the length of the list

Reading / Overwriting Arrays shopping_list = [“eggs”, “bread”, “juice”, “Butter”] To read / print the first item in the array: print (shopping_list[0]) To read / print the second item in the array: print (shopping_list[1]) To over write the second item in the array: shopping_list[1] = “white bread” The list positions begins at 0, so [0] is item one in the list, the eggs Replacing simple uses the = and the new value

Reading / Overwriting Arrays shopping_list = [“eggs”, “bread”, “juice”, “Butter”] shopping_list[1] = "white bread" print (shopping_list) Task Replace the eggs with apples Replace juice with orange juice Lists numbering or indexing starts at ZERO In the second printed statement the ‘bread’ is replaced with ‘white bread’

Print more than one item Print a range of entries from the list, say the first three shopping_list = ["eggs", "bread", "juice", "Butter"] print (shopping_list[0:3]) Task What items would be displayed? print (shopping_list[1:4]) This uses a technique called slicing, to slice into a section of the items that you want Note that the list starts from 0 and the items in position 0, 1, and 2 are displayed In the second example , bread, juice and butter would be displayed

Try the array task