SlideShare a Scribd company logo
https://softuni.org
Processing Elements in C#, Java, JS and Python
Arrays and Lists in Programming
Svetlin Nakov, PhD
Co-Founder, Innovation and
Inspiration Manager at SoftUni
https://nakov.com
sli.do
#nakov
Have a Question?
2
3
 The 4 groups of software development skills
 Coding, algorithms, development concepts, technologies
 Arrays and lists: processing groups of elements in programming
 Arrays and lists in C#
 Arrays and lists in Java
 Arrays and lists in JavaScript
 Arrays and lists in Python
 How to become a software developer?
Agenda
 Coding skills – 20%
 Algorithmic thinking – 30%
 Fundamental concepts of the
software developer profession – 25%
 Programming languages &
software technologies – 25%
Skills of Software Developers
4
Arrays and Lists
 In programming, an array is a sequence of elements
 Values are typically of the same type (e.g. numbers)
 Elements are numbered: 0 … length-1
 In C# and Java arrays have
fixed size: cannot be resized
What are Arrays?
6
Array of 5
elements
(length = 5)
Element index
Element of an array
… … … … …
0 1 2 3 4
 The days of week can be stored in array of strings:
Days of Week – Example
7
string[] days = {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
};
Element Value
days[0] Monday
days[1] Tuesday
days[2] Wednesday
days[3] Thursday
days[4] Friday
days[5] Saturday
days[6] Sunday
8
 In programming, a list is a resizable sequence of elements
 Some programming languages (like JS and Python) almost do
not distinguish between arrays and lists
 Other linear structures:
 Linked lists: each element holds a value + link to the next
 Stack (last in last out – LIFO)
 Queue (first in, first out – FIFO)
Lists: Indexed, Mutable Sequences of Elements
 List of numbers, representing a sequence of income amounts:
 Adding a new income:
List of Numbers– Example
9
var incomes = [
150, 200, 70.50, 120
];
Element Value
incomes[0] 150
incomes[1] 200
incomes[2] 70.50
incomes[3] 120
incomes.push(300); incomes[4] 300
Arrays and Lists in C#
https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
11
Lists in C#
var incomes = new List<double> {
150, 200, 70.50, 120
};
// Print the list using a foreach-loop
Console.WriteLine("Incomes:");
foreach (var amount in incomes)
Console.WriteLine(amount);
// Add a new element
incomes.Add(300);
12
Lists in C# (2)
// Print the list using String.Join()
Console.WriteLine("Incomes: {0}n",
String.Join(", ", incomes));
// Calculate count, sum, average, first, second, last
Console.WriteLine("Count = {0}", incomes.Count);
Console.WriteLine("First = {0}", incomes.First());
Console.WriteLine("Second = {0}", incomes.Skip(1).First());
Console.WriteLine("Last = {0}", incomes.Last());
Console.WriteLine("Sum = {0}", incomes.Sum());
Console.WriteLine("Avg = {0}", incomes.Average());
13
Lists in C# (3)
// Remove the elements at positions 1 … 3
incomes.RemoveRange(1, 3);
// Print the list using a for-loop
Console.WriteLine("Incomes:");
for (var i = 0; i < incomes.Count; i++)
Console.WriteLine(incomes[i]);
150 200 70.5 120 300
0 1 2 3 4
// Modify an existing element: 20% up
incomes[0] = incomes[0] * 1.20; 150 300
0 1
180 300
0 1
Arrays and Lists in Java
https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
Arrays and Lists
in JavaScript
https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
Arrays and Lists
in Python
https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
How to Become a
Software Engineer?
 First find out if programming is for you!
 Sign up for the SoftUni free coding course
for beginners: https://softuni.bg/apply
 Or follow a tutorial / book / video course on the Internet
 Does programming excite you?
 Do you really like it and enjoy it?
 Are you good at coding problems?
 Do you want to write code all the time?
How do I Become a Software Engineer?
18
 Coding skills – 20%
 Algorithmic thinking – 30%
 Fundamental concepts of the
software developer profession – 25%
 Programming languages &
software technologies – 25%
Learn the 4 of Fundamental Skills
19
 To become a software engineer, you need to study
hard and consistently for 3000+ hours!
 2 years @ 4 hours daily (average)
 Or 1 year @ 8-10 hours daily
 Developing practical projects
 Write 100K+ lines of code (LOC)
 100K LOC == 300 days * 350 LOC
Study Hard, Very Hard!
20
Learning Path: From Zero to First Job
21
https://softuni.bg/curriculum
Sign Up for SoftUni!
https://softuni.bg/apply
22
SoftUni – https://softuni.bg 2

More Related Content

What's hot (19)

DOCX
CBSE Class 12 Computer practical Python Programs and MYSQL
Rishabh-Rawat
 
PPTX
c++
SindhuVelmukull
 
PDF
College1
Sudharsan S
 
PDF
C++
Shyam Khant
 
PPT
C++ programming program design including data structures
Ahmad Idrees
 
PDF
Session 5-exersice
Keroles karam khalil
 
PDF
important C questions and_answers praveensomesh
praveensomesh
 
PPTX
C++ AND CATEGORIES OF SOFTWARE
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA
 
ODP
(2) cpp imperative programming
Nico Ludwig
 
PDF
Cse115 lecture08repetitionstructures part02
Md. Ashikur Rahman
 
DOCX
C programming Lab 1
Zaibi Gondal
 
PDF
C++ Tokens
Amrit Kaur
 
PPTX
Intro to c++
temkin abdlkader
 
PPT
Beginner C++ easy slide and simple definition with questions
khawajasharif
 
PDF
Develop Embedded Software Module-Session 3
Naveen Kumar
 
DOCX
C program report tips
Harry Pott
 
PPT
Basics of c++
Madhavendra Dutt
 
PDF
Cse115 lecture02overviewofprogramming
Md. Ashikur Rahman
 
PPTX
Cs1123 3 c++ overview
TAlha MAlik
 
CBSE Class 12 Computer practical Python Programs and MYSQL
Rishabh-Rawat
 
College1
Sudharsan S
 
C++ programming program design including data structures
Ahmad Idrees
 
Session 5-exersice
Keroles karam khalil
 
important C questions and_answers praveensomesh
praveensomesh
 
C++ AND CATEGORIES OF SOFTWARE
UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA
 
(2) cpp imperative programming
Nico Ludwig
 
Cse115 lecture08repetitionstructures part02
Md. Ashikur Rahman
 
C programming Lab 1
Zaibi Gondal
 
C++ Tokens
Amrit Kaur
 
Intro to c++
temkin abdlkader
 
Beginner C++ easy slide and simple definition with questions
khawajasharif
 
Develop Embedded Software Module-Session 3
Naveen Kumar
 
C program report tips
Harry Pott
 
Basics of c++
Madhavendra Dutt
 
Cse115 lecture02overviewofprogramming
Md. Ashikur Rahman
 
Cs1123 3 c++ overview
TAlha MAlik
 

Similar to Arrays and Lists in C#, Java, Python and JavaScript (20)

PPTX
arrays-120712074248-phpapp01
Abdul Samee
 
PPTX
16. Arrays Lists Stacks Queues
Intro C# Book
 
PPT
07 Arrays
maznabili
 
PPTX
Loops in C# for loops while and do while loop.
Abid Kohistani
 
PPTX
07. Arrays
Intro C# Book
 
PDF
C sharp chap6
Mukesh Tekwani
 
PPTX
Software fundamentals
Susan Winters
 
PPTX
Aspdot
Nishad Nizarudeen
 
PDF
LectureNotes-03-DSA
Haitham El-Ghareeb
 
PPT
For Beginners - C#
Snehal Harawande
 
PPTX
Java Foundations: Arrays
Svetlin Nakov
 
PDF
Good programming
Won Kwang University
 
PPTX
Welcome to SoftUni (Software University)
Svetlin Nakov
 
PPTX
Introduction to Data Structures & Algorithms
Afaq Mansoor Khan
 
PPTX
Lecture 2 - Linear Data Structures & Implementation.pptx
michaelsayuni29
 
PPTX
Visual Programing basic lectures 7.pptx
Mrhaider4
 
PPTX
C# basics
sagaroceanic11
 
PPTX
How to learn programming for begineers!
Aman Kumar
 
PPTX
Introduction to data structures - Explore the basics
divyammo
 
PDF
(2) collections algorithms
Nico Ludwig
 
arrays-120712074248-phpapp01
Abdul Samee
 
16. Arrays Lists Stacks Queues
Intro C# Book
 
07 Arrays
maznabili
 
Loops in C# for loops while and do while loop.
Abid Kohistani
 
07. Arrays
Intro C# Book
 
C sharp chap6
Mukesh Tekwani
 
Software fundamentals
Susan Winters
 
LectureNotes-03-DSA
Haitham El-Ghareeb
 
For Beginners - C#
Snehal Harawande
 
Java Foundations: Arrays
Svetlin Nakov
 
Good programming
Won Kwang University
 
Welcome to SoftUni (Software University)
Svetlin Nakov
 
Introduction to Data Structures & Algorithms
Afaq Mansoor Khan
 
Lecture 2 - Linear Data Structures & Implementation.pptx
michaelsayuni29
 
Visual Programing basic lectures 7.pptx
Mrhaider4
 
C# basics
sagaroceanic11
 
How to learn programming for begineers!
Aman Kumar
 
Introduction to data structures - Explore the basics
divyammo
 
(2) collections algorithms
Nico Ludwig
 
Ad

More from Svetlin Nakov (20)

PPTX
AI and the Future of Devs: Nakov @ Techniverse (Nov 2024)
Svetlin Nakov
 
PPTX
AI за ежедневието - Наков @ Techniverse (Nov 2024)
Svetlin Nakov
 
PPTX
AI инструменти за бизнеса - Наков - Nov 2024
Svetlin Nakov
 
PPTX
AI Adoption in Business - Nakov at Forbes HR Forum - Sept 2024
Svetlin Nakov
 
PPTX
Software Engineers in the AI Era - Sept 2024
Svetlin Nakov
 
PPTX
Най-търсените направления в ИТ сферата за 2024
Svetlin Nakov
 
PPTX
BG-IT-Edu: отворено учебно съдържание за ИТ учители
Svetlin Nakov
 
PPTX
Programming World in 2024
Svetlin Nakov
 
PDF
AI Tools for Business and Startups
Svetlin Nakov
 
PPTX
AI Tools for Scientists - Nakov (Oct 2023)
Svetlin Nakov
 
PPTX
AI Tools for Entrepreneurs
Svetlin Nakov
 
PPTX
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
Svetlin Nakov
 
PPTX
AI Tools for Business and Personal Life
Svetlin Nakov
 
PDF
Дипломна работа: учебно съдържание по ООП - Светлин Наков
Svetlin Nakov
 
PPTX
Дипломна работа: учебно съдържание по ООП
Svetlin Nakov
 
PPTX
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
Svetlin Nakov
 
PPTX
AI and the Professions of the Future
Svetlin Nakov
 
PPTX
Programming Languages Trends for 2023
Svetlin Nakov
 
PPTX
IT Professions and How to Become a Developer
Svetlin Nakov
 
PPTX
GitHub Actions (Nakov at RuseConf, Sept 2022)
Svetlin Nakov
 
AI and the Future of Devs: Nakov @ Techniverse (Nov 2024)
Svetlin Nakov
 
AI за ежедневието - Наков @ Techniverse (Nov 2024)
Svetlin Nakov
 
AI инструменти за бизнеса - Наков - Nov 2024
Svetlin Nakov
 
AI Adoption in Business - Nakov at Forbes HR Forum - Sept 2024
Svetlin Nakov
 
Software Engineers in the AI Era - Sept 2024
Svetlin Nakov
 
Най-търсените направления в ИТ сферата за 2024
Svetlin Nakov
 
BG-IT-Edu: отворено учебно съдържание за ИТ учители
Svetlin Nakov
 
Programming World in 2024
Svetlin Nakov
 
AI Tools for Business and Startups
Svetlin Nakov
 
AI Tools for Scientists - Nakov (Oct 2023)
Svetlin Nakov
 
AI Tools for Entrepreneurs
Svetlin Nakov
 
Bulgarian Tech Industry - Nakov at Dev.BG All in One Conference 2023
Svetlin Nakov
 
AI Tools for Business and Personal Life
Svetlin Nakov
 
Дипломна работа: учебно съдържание по ООП - Светлин Наков
Svetlin Nakov
 
Дипломна работа: учебно съдържание по ООП
Svetlin Nakov
 
Свободно ИТ учебно съдържание за учители по програмиране и ИТ
Svetlin Nakov
 
AI and the Professions of the Future
Svetlin Nakov
 
Programming Languages Trends for 2023
Svetlin Nakov
 
IT Professions and How to Become a Developer
Svetlin Nakov
 
GitHub Actions (Nakov at RuseConf, Sept 2022)
Svetlin Nakov
 
Ad

Recently uploaded (20)

PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 

Arrays and Lists in C#, Java, Python and JavaScript

  • 1. https://softuni.org Processing Elements in C#, Java, JS and Python Arrays and Lists in Programming Svetlin Nakov, PhD Co-Founder, Innovation and Inspiration Manager at SoftUni https://nakov.com
  • 3. 3  The 4 groups of software development skills  Coding, algorithms, development concepts, technologies  Arrays and lists: processing groups of elements in programming  Arrays and lists in C#  Arrays and lists in Java  Arrays and lists in JavaScript  Arrays and lists in Python  How to become a software developer? Agenda
  • 4.  Coding skills – 20%  Algorithmic thinking – 30%  Fundamental concepts of the software developer profession – 25%  Programming languages & software technologies – 25% Skills of Software Developers 4
  • 6.  In programming, an array is a sequence of elements  Values are typically of the same type (e.g. numbers)  Elements are numbered: 0 … length-1  In C# and Java arrays have fixed size: cannot be resized What are Arrays? 6 Array of 5 elements (length = 5) Element index Element of an array … … … … … 0 1 2 3 4
  • 7.  The days of week can be stored in array of strings: Days of Week – Example 7 string[] days = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" }; Element Value days[0] Monday days[1] Tuesday days[2] Wednesday days[3] Thursday days[4] Friday days[5] Saturday days[6] Sunday
  • 8. 8  In programming, a list is a resizable sequence of elements  Some programming languages (like JS and Python) almost do not distinguish between arrays and lists  Other linear structures:  Linked lists: each element holds a value + link to the next  Stack (last in last out – LIFO)  Queue (first in, first out – FIFO) Lists: Indexed, Mutable Sequences of Elements
  • 9.  List of numbers, representing a sequence of income amounts:  Adding a new income: List of Numbers– Example 9 var incomes = [ 150, 200, 70.50, 120 ]; Element Value incomes[0] 150 incomes[1] 200 incomes[2] 70.50 incomes[3] 120 incomes.push(300); incomes[4] 300
  • 10. Arrays and Lists in C# https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
  • 11. 11 Lists in C# var incomes = new List<double> { 150, 200, 70.50, 120 }; // Print the list using a foreach-loop Console.WriteLine("Incomes:"); foreach (var amount in incomes) Console.WriteLine(amount); // Add a new element incomes.Add(300);
  • 12. 12 Lists in C# (2) // Print the list using String.Join() Console.WriteLine("Incomes: {0}n", String.Join(", ", incomes)); // Calculate count, sum, average, first, second, last Console.WriteLine("Count = {0}", incomes.Count); Console.WriteLine("First = {0}", incomes.First()); Console.WriteLine("Second = {0}", incomes.Skip(1).First()); Console.WriteLine("Last = {0}", incomes.Last()); Console.WriteLine("Sum = {0}", incomes.Sum()); Console.WriteLine("Avg = {0}", incomes.Average());
  • 13. 13 Lists in C# (3) // Remove the elements at positions 1 … 3 incomes.RemoveRange(1, 3); // Print the list using a for-loop Console.WriteLine("Incomes:"); for (var i = 0; i < incomes.Count; i++) Console.WriteLine(incomes[i]); 150 200 70.5 120 300 0 1 2 3 4 // Modify an existing element: 20% up incomes[0] = incomes[0] * 1.20; 150 300 0 1 180 300 0 1
  • 14. Arrays and Lists in Java https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
  • 15. Arrays and Lists in JavaScript https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
  • 16. Arrays and Lists in Python https://gist.github.com/nakov/8ebbd98c22915e5b261d0bb1a8f11608
  • 17. How to Become a Software Engineer?
  • 18.  First find out if programming is for you!  Sign up for the SoftUni free coding course for beginners: https://softuni.bg/apply  Or follow a tutorial / book / video course on the Internet  Does programming excite you?  Do you really like it and enjoy it?  Are you good at coding problems?  Do you want to write code all the time? How do I Become a Software Engineer? 18
  • 19.  Coding skills – 20%  Algorithmic thinking – 30%  Fundamental concepts of the software developer profession – 25%  Programming languages & software technologies – 25% Learn the 4 of Fundamental Skills 19
  • 20.  To become a software engineer, you need to study hard and consistently for 3000+ hours!  2 years @ 4 hours daily (average)  Or 1 year @ 8-10 hours daily  Developing practical projects  Write 100K+ lines of code (LOC)  100K LOC == 300 days * 350 LOC Study Hard, Very Hard! 20
  • 21. Learning Path: From Zero to First Job 21 https://softuni.bg/curriculum
  • 22. Sign Up for SoftUni! https://softuni.bg/apply 22