SlideShare ist ein Scribd-Unternehmen logo
1 von 5
WHAT IS A VARIABLE?
A variable is a value in a program that can be changed when you are
running the program.
Variable need to be given names e.g. (“name”, “age”, “gender”)
Variable are written in a program as follows:
age = 14
However if you want to change the variable while running your program you
need to write it in the code like this:
age = input(“How old are you?”)
INSERTING A VARIABLE
In the blank window that opens type in the following.
print("Hello")
print("My name is Python")
name = input(“What is your name?”)
Print((“Hello”, name)
input("Please press enter to exit")
This is where you create
a variable. And output it
onto the screen
RUNNING YOUR PROGRAM
To run your program press F5 on the keyboard, you
will then see the following
Click OK you may see the following click OK on this and then you can save
the file in your folders, once you have done this your file will run in the
shell..
WHAT OUTPUT SHOULD YOU SEE
If you type in
your name when
asked and press
enter the
program will run
as shown

Weitere ähnliche Inhalte

Was ist angesagt?

PSoC Creator Installation Guide
PSoC Creator Installation GuidePSoC Creator Installation Guide
PSoC Creator Installation Guide
Srinivas A N
 
Instalasi firefox di komputer
Instalasi firefox di komputerInstalasi firefox di komputer
Instalasi firefox di komputer
Toko UKM
 

Was ist angesagt? (13)

What are Chrome DevTools?
What are Chrome DevTools?What are Chrome DevTools?
What are Chrome DevTools?
 
Cara flashing axioo
Cara flashing axiooCara flashing axioo
Cara flashing axioo
 
Tricks to hack notepad
Tricks to hack notepadTricks to hack notepad
Tricks to hack notepad
 
Fix Google Chrome Crashes
Fix Google Chrome CrashesFix Google Chrome Crashes
Fix Google Chrome Crashes
 
Hot Potatoes Add Audio
Hot Potatoes Add AudioHot Potatoes Add Audio
Hot Potatoes Add Audio
 
Hot Potatoes Cloze Text Entry
Hot Potatoes Cloze Text EntryHot Potatoes Cloze Text Entry
Hot Potatoes Cloze Text Entry
 
Slide Share
Slide ShareSlide Share
Slide Share
 
Android Lab Test : Using the text-to-speech (english)
Android Lab Test : Using the text-to-speech (english)Android Lab Test : Using the text-to-speech (english)
Android Lab Test : Using the text-to-speech (english)
 
UGS NX-7.5 Installation Guide
UGS NX-7.5 Installation GuideUGS NX-7.5 Installation Guide
UGS NX-7.5 Installation Guide
 
PSoC Creator Installation Guide
PSoC Creator Installation GuidePSoC Creator Installation Guide
PSoC Creator Installation Guide
 
Instalasi firefox di komputer
Instalasi firefox di komputerInstalasi firefox di komputer
Instalasi firefox di komputer
 
Gassumo Outlook Android Task Synchronizer v1.0.0.7 Installation and first syn...
Gassumo Outlook Android Task Synchronizer v1.0.0.7 Installation and first syn...Gassumo Outlook Android Task Synchronizer v1.0.0.7 Installation and first syn...
Gassumo Outlook Android Task Synchronizer v1.0.0.7 Installation and first syn...
 
Advertisement free YouTube, Dailymotion videos
Advertisement free YouTube, Dailymotion videos Advertisement free YouTube, Dailymotion videos
Advertisement free YouTube, Dailymotion videos
 

Andere mochten auch

Add behaviours lesson2
Add behaviours lesson2Add behaviours lesson2
Add behaviours lesson2
ahunneyball
 
Photoshop Lesson 5
Photoshop Lesson 5Photoshop Lesson 5
Photoshop Lesson 5
ahunneyball
 
Photoshop Lesson 7
Photoshop Lesson 7Photoshop Lesson 7
Photoshop Lesson 7
ahunneyball
 
Photoshop Lesson 3
Photoshop Lesson 3Photoshop Lesson 3
Photoshop Lesson 3
ahunneyball
 
Photoshop Lesson 4
Photoshop Lesson 4Photoshop Lesson 4
Photoshop Lesson 4
ahunneyball
 
Photoshop Lesson 6
Photoshop Lesson 6Photoshop Lesson 6
Photoshop Lesson 6
ahunneyball
 
Part 5 – animating your character
Part 5 – animating your characterPart 5 – animating your character
Part 5 – animating your character
Andrew Willetts
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
vinay arora
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
Abha Damani
 

Andere mochten auch (19)

Programming Challenge
Programming ChallengeProgramming Challenge
Programming Challenge
 
Lesson 4 Part 1
Lesson 4 Part 1Lesson 4 Part 1
Lesson 4 Part 1
 
Add behaviours lesson2
Add behaviours lesson2Add behaviours lesson2
Add behaviours lesson2
 
Photoshop Lesson 5
Photoshop Lesson 5Photoshop Lesson 5
Photoshop Lesson 5
 
Photoshop Lesson 7
Photoshop Lesson 7Photoshop Lesson 7
Photoshop Lesson 7
 
Photoshop Lesson 3
Photoshop Lesson 3Photoshop Lesson 3
Photoshop Lesson 3
 
Photoshop Lesson 4
Photoshop Lesson 4Photoshop Lesson 4
Photoshop Lesson 4
 
Photoshop Lesson 6
Photoshop Lesson 6Photoshop Lesson 6
Photoshop Lesson 6
 
Photoshop lesson 2
Photoshop lesson 2Photoshop lesson 2
Photoshop lesson 2
 
Part 5 – animating your character
Part 5 – animating your characterPart 5 – animating your character
Part 5 – animating your character
 
Constants and variables in c programming
Constants and variables in c programmingConstants and variables in c programming
Constants and variables in c programming
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
 
Photoshop lesson 1
Photoshop lesson 1Photoshop lesson 1
Photoshop lesson 1
 
PHP Basic & Variables
PHP Basic & VariablesPHP Basic & Variables
PHP Basic & Variables
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
Data type
Data typeData type
Data type
 
Unit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programmingUnit 1 introduction to visual basic programming
Unit 1 introduction to visual basic programming
 
Data types
Data typesData types
Data types
 
Basic variables ppt
Basic variables pptBasic variables ppt
Basic variables ppt
 

Ähnlich wie Programming Variables

An introduction to microsoft_word
An introduction to microsoft_wordAn introduction to microsoft_word
An introduction to microsoft_word
uzmabb12045
 
How to create a word document
How to create a word documentHow to create a word document
How to create a word document
erinogrady02
 
Cotopaxi App Runthrough for Questival
Cotopaxi App Runthrough for QuestivalCotopaxi App Runthrough for Questival
Cotopaxi App Runthrough for Questival
LlamaAnders
 

Ähnlich wie Programming Variables (20)

App project
App projectApp project
App project
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1ILearn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
 
Maximizing PowerPoint for Social Media Graphics
Maximizing PowerPoint for Social Media GraphicsMaximizing PowerPoint for Social Media Graphics
Maximizing PowerPoint for Social Media Graphics
 
programming.ppt
programming.pptprogramming.ppt
programming.ppt
 
How to use Google Docs
How to use Google DocsHow to use Google Docs
How to use Google Docs
 
Ms word 2007.
Ms word 2007.Ms word 2007.
Ms word 2007.
 
03 eclipse basics & hello world
03   eclipse basics & hello world03   eclipse basics & hello world
03 eclipse basics & hello world
 
To Function Or Not To Function
To Function Or Not To FunctionTo Function Or Not To Function
To Function Or Not To Function
 
Vocabulary Manager
Vocabulary ManagerVocabulary Manager
Vocabulary Manager
 
Programming
ProgrammingProgramming
Programming
 
Word Q Lesson 1
Word Q Lesson 1Word Q Lesson 1
Word Q Lesson 1
 
feelDweb official guide
feelDweb official guidefeelDweb official guide
feelDweb official guide
 
An introduction to microsoft_word
An introduction to microsoft_wordAn introduction to microsoft_word
An introduction to microsoft_word
 
How to create a word document
How to create a word documentHow to create a word document
How to create a word document
 
Introduction to Programming and QBasic Tutorial
Introduction to Programming and QBasic TutorialIntroduction to Programming and QBasic Tutorial
Introduction to Programming and QBasic Tutorial
 
Word Q Lesson 1
Word Q Lesson 1Word Q Lesson 1
Word Q Lesson 1
 
Q basic ch
Q basic chQ basic ch
Q basic ch
 
How to use Asana
How to use AsanaHow to use Asana
How to use Asana
 
How to use canva for social media marketing
How to use canva for social media marketingHow to use canva for social media marketing
How to use canva for social media marketing
 
Cotopaxi App Runthrough for Questival
Cotopaxi App Runthrough for QuestivalCotopaxi App Runthrough for Questival
Cotopaxi App Runthrough for Questival
 

Mehr von Andrew Willetts

Photoshop tutorial 2 rubber and quick select tools
Photoshop tutorial 2   rubber and quick select toolsPhotoshop tutorial 2   rubber and quick select tools
Photoshop tutorial 2 rubber and quick select tools
Andrew Willetts
 
Photoshop tutorial 1 setting up the canvas
Photoshop tutorial 1   setting up the canvasPhotoshop tutorial 1   setting up the canvas
Photoshop tutorial 1 setting up the canvas
Andrew Willetts
 
Alice part 2 – background objects
Alice part 2 – background objectsAlice part 2 – background objects
Alice part 2 – background objects
Andrew Willetts
 
Alice part 1 – getting started Update
Alice part 1 – getting started UpdateAlice part 1 – getting started Update
Alice part 1 – getting started Update
Andrew Willetts
 
Alice part 3 – adding text
Alice part 3 – adding textAlice part 3 – adding text
Alice part 3 – adding text
Andrew Willetts
 
Alice part 1 – getting started
Alice part 1 – getting startedAlice part 1 – getting started
Alice part 1 – getting started
Andrew Willetts
 

Mehr von Andrew Willetts (20)

Photoshop tutorial 6 desaturisation
Photoshop tutorial 6   desaturisationPhotoshop tutorial 6   desaturisation
Photoshop tutorial 6 desaturisation
 
Photoshop tutorial 5 clipping masks
Photoshop tutorial 5   clipping masksPhotoshop tutorial 5   clipping masks
Photoshop tutorial 5 clipping masks
 
Photoshop tutorial 4 spot healing tool
Photoshop tutorial 4   spot healing toolPhotoshop tutorial 4   spot healing tool
Photoshop tutorial 4 spot healing tool
 
Photoshop tutorial 3 stamp tool
Photoshop tutorial 3   stamp toolPhotoshop tutorial 3   stamp tool
Photoshop tutorial 3 stamp tool
 
Year 8 python part 1 - debugging
Year 8 python part 1 - debuggingYear 8 python part 1 - debugging
Year 8 python part 1 - debugging
 
Year 8 python part 1 - debugging
Year 8 python part 1 - debuggingYear 8 python part 1 - debugging
Year 8 python part 1 - debugging
 
Year 7 e-safety part 2
Year 7   e-safety part 2Year 7   e-safety part 2
Year 7 e-safety part 2
 
Year 7 e-safety part 1
Year 7   e-safety part 1Year 7   e-safety part 1
Year 7 e-safety part 1
 
Photoshop tutorial 2 rubber and quick select tools
Photoshop tutorial 2   rubber and quick select toolsPhotoshop tutorial 2   rubber and quick select tools
Photoshop tutorial 2 rubber and quick select tools
 
Photoshop tutorial 1 setting up the canvas
Photoshop tutorial 1   setting up the canvasPhotoshop tutorial 1   setting up the canvas
Photoshop tutorial 1 setting up the canvas
 
03 outputs
03   outputs03   outputs
03 outputs
 
inputs
inputsinputs
inputs
 
Computer Devices - What Are they?
Computer Devices - What Are they?Computer Devices - What Are they?
Computer Devices - What Are they?
 
Data Flow Diagrams
Data Flow DiagramsData Flow Diagrams
Data Flow Diagrams
 
Databases dfd
Databases dfdDatabases dfd
Databases dfd
 
Data flow diagrams
Data flow diagramsData flow diagrams
Data flow diagrams
 
Alice part 2 – background objects
Alice part 2 – background objectsAlice part 2 – background objects
Alice part 2 – background objects
 
Alice part 1 – getting started Update
Alice part 1 – getting started UpdateAlice part 1 – getting started Update
Alice part 1 – getting started Update
 
Alice part 3 – adding text
Alice part 3 – adding textAlice part 3 – adding text
Alice part 3 – adding text
 
Alice part 1 – getting started
Alice part 1 – getting startedAlice part 1 – getting started
Alice part 1 – getting started
 

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 

Programming Variables

  • 1.
  • 2. WHAT IS A VARIABLE? A variable is a value in a program that can be changed when you are running the program. Variable need to be given names e.g. (“name”, “age”, “gender”) Variable are written in a program as follows: age = 14 However if you want to change the variable while running your program you need to write it in the code like this: age = input(“How old are you?”)
  • 3. INSERTING A VARIABLE In the blank window that opens type in the following. print("Hello") print("My name is Python") name = input(“What is your name?”) Print((“Hello”, name) input("Please press enter to exit") This is where you create a variable. And output it onto the screen
  • 4. RUNNING YOUR PROGRAM To run your program press F5 on the keyboard, you will then see the following Click OK you may see the following click OK on this and then you can save the file in your folders, once you have done this your file will run in the shell..
  • 5. WHAT OUTPUT SHOULD YOU SEE If you type in your name when asked and press enter the program will run as shown