Python for kids
Part 1
I am Aditya
I am here because I love to sharing my
knowledge.
You can find me at @techyAdi:Coding for kids
2
Hello!
Roadmap
3
1 3 5
6
4
2
What is Python? First Program
Variables,
Literals, Data
Types
Download
Python
Rules for
Identifiers
And comments
Input in python
What is
Python?
Python is a programming
language that lets you work
quickly and integrate systems
more effectively.
4
Applications of python
1. Web Development
2. Game Development
3. Machine Learning
4. Mathematics
5. Education: Python is a superb language for teaching
programming, both at the introductory level and in more
advanced courses.
6. Desktop GUI
7. Software Development: Python is often used as a support
language for software developers, for build control and
management, testing, and in many other ways.
8. Operating System
9. Artificial Intelligence
10. Internet of Things (IoT)
5
Download
Python
6
https://www.python.org/downloads/
Where to use python online
▪ Ideone : https://ideone.com/
▪ GBD compiler:
https://www.onlinegdb.com/
▪ Google Colab:
https://colab.research.google.com/
And many more...
7
Hello World!
My first program in python
8
Code
print(“hello world!”)
9
What are identifiers
10
A Python identifier is a name used to identify a
variable, function, class, module or other object.
Rules for naming identifiers
▪ Identifiers can be a combination of letters in
lowercase (a to z) or uppercase (A to Z) or digits (0
to 9) or an underscore _. Names like myClass,
var_1 and print_this_to_screen, all are valid
example.
▪ An identifier cannot start with a digit. 1variable is
invalid, but variable1 is a valid name.
▪ Keywords cannot be used as identifiers.
▪ We cannot use special symbols like !, @, #, $, %
etc. in our identifier.
▪ An identifier can be of any length.
11
What are Keywords
12
Keywords are reserved words and you cannot
use them as constant or variable or any other
identifier names. All the Python keywords
contain lowercase letters only.
Keywords in python are:
13
and exec not
assert finally or
break for pass
class from print
continue global raise
def if return
del import try
elif in while
else is with
Comments in
Python
14
Single Line Comments: Python single line comment
starts with hashtag symbol with no white spaces (#)
and lasts till the end of the line.
Comments in
Python
15
Multi-Line Comments: Python multi-line comment is
a piece of text enclosed in a delimiter (""") on each
end of the comment.
variables
Reserved memory locations to store values
16
17
Using variables in python
Assignment operator (=) is used to
assign a value to a variable.
18
Literals
Raw data given in a variable or constant
19
Data Types in
python
20
String: sequence of characters surrounded by quotes.
Numeric: they are of three types:
▪ Integer
▪ Float
▪ Complex
Boolean: It can have only two values (true/false)
Collections
21
Lists: List is an ordered sequence of items. All the
items in a list do not need to be of the same type.
22
Collections
Tuple: They are like lists but cannot be modified.
23
Collections
Set: Set is a unordered collection of unique items.
Collections
24
Dictionary: Dictionary is an unordered collection of
key-value pairs. It is generally used when we have a
huge amount of data. Dictionaries are optimized for
retrieving data. We must know the key to retrieve the
value.
Input in python
Using input()
25
26
27
Exercise
1. Write a program to enter a number and print 5 times of
that number. (number *5).
2. Write a program to define a set of numbers in table of
19.
3. Write a program to input two numbers and print their
sum.
Solutions
28
Link for all Code
https://colab.research.google.com/driv
e/1yMTEr3tL7eYkYeiuXwgVNuxqc7MF
bMhA?usp=sharing
Extra Resources
● https://www.youtube.com/watch?v=73
DKe1W5KmU&t=9s
● https://www.youtube.com/watch?v=Er
J0DHZIHVk
● https://www.youtube.com/watch?v
=-KToCMl9XT0
● https://www.youtube.com/watch?v
=SF7IYpAab60&t=4s
Any questions?
You can find me at:
▪ minku.aditya2012@gmail.com
▪ https://www.facebook.com/techy
Adi.Coding
31

Python for kids - 1.pptx

  • 1.
  • 2.
    I am Aditya Iam here because I love to sharing my knowledge. You can find me at @techyAdi:Coding for kids 2 Hello!
  • 3.
    Roadmap 3 1 3 5 6 4 2 Whatis Python? First Program Variables, Literals, Data Types Download Python Rules for Identifiers And comments Input in python
  • 4.
    What is Python? Python isa programming language that lets you work quickly and integrate systems more effectively. 4
  • 5.
    Applications of python 1.Web Development 2. Game Development 3. Machine Learning 4. Mathematics 5. Education: Python is a superb language for teaching programming, both at the introductory level and in more advanced courses. 6. Desktop GUI 7. Software Development: Python is often used as a support language for software developers, for build control and management, testing, and in many other ways. 8. Operating System 9. Artificial Intelligence 10. Internet of Things (IoT) 5
  • 6.
  • 7.
    Where to usepython online ▪ Ideone : https://ideone.com/ ▪ GBD compiler: https://www.onlinegdb.com/ ▪ Google Colab: https://colab.research.google.com/ And many more... 7
  • 8.
    Hello World! My firstprogram in python 8
  • 9.
  • 10.
    What are identifiers 10 APython identifier is a name used to identify a variable, function, class, module or other object.
  • 11.
    Rules for namingidentifiers ▪ Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore _. Names like myClass, var_1 and print_this_to_screen, all are valid example. ▪ An identifier cannot start with a digit. 1variable is invalid, but variable1 is a valid name. ▪ Keywords cannot be used as identifiers. ▪ We cannot use special symbols like !, @, #, $, % etc. in our identifier. ▪ An identifier can be of any length. 11
  • 12.
    What are Keywords 12 Keywordsare reserved words and you cannot use them as constant or variable or any other identifier names. All the Python keywords contain lowercase letters only.
  • 13.
    Keywords in pythonare: 13 and exec not assert finally or break for pass class from print continue global raise def if return del import try elif in while else is with
  • 14.
    Comments in Python 14 Single LineComments: Python single line comment starts with hashtag symbol with no white spaces (#) and lasts till the end of the line.
  • 15.
    Comments in Python 15 Multi-Line Comments:Python multi-line comment is a piece of text enclosed in a delimiter (""") on each end of the comment.
  • 16.
  • 17.
  • 18.
    Using variables inpython Assignment operator (=) is used to assign a value to a variable. 18
  • 19.
    Literals Raw data givenin a variable or constant 19
  • 20.
    Data Types in python 20 String:sequence of characters surrounded by quotes. Numeric: they are of three types: ▪ Integer ▪ Float ▪ Complex Boolean: It can have only two values (true/false)
  • 21.
    Collections 21 Lists: List isan ordered sequence of items. All the items in a list do not need to be of the same type.
  • 22.
    22 Collections Tuple: They arelike lists but cannot be modified.
  • 23.
    23 Collections Set: Set isa unordered collection of unique items.
  • 24.
    Collections 24 Dictionary: Dictionary isan unordered collection of key-value pairs. It is generally used when we have a huge amount of data. Dictionaries are optimized for retrieving data. We must know the key to retrieve the value.
  • 25.
  • 26.
  • 27.
    27 Exercise 1. Write aprogram to enter a number and print 5 times of that number. (number *5). 2. Write a program to define a set of numbers in table of 19. 3. Write a program to input two numbers and print their sum.
  • 28.
  • 29.
    Link for allCode https://colab.research.google.com/driv e/1yMTEr3tL7eYkYeiuXwgVNuxqc7MF bMhA?usp=sharing
  • 30.
    Extra Resources ● https://www.youtube.com/watch?v=73 DKe1W5KmU&t=9s ●https://www.youtube.com/watch?v=Er J0DHZIHVk ● https://www.youtube.com/watch?v =-KToCMl9XT0 ● https://www.youtube.com/watch?v =SF7IYpAab60&t=4s
  • 31.
    Any questions? You canfind me at: ▪ minku.aditya2012@gmail.com ▪ https://www.facebook.com/techy Adi.Coding 31