SlideShare a Scribd company logo
Python 2
Variables, Assignment and
Types
Personality Tester
yournumber = input("Please enter a number between 1 and 99: ")
print "You entered " , yournumber
print "Performing personality analysis on your number choice …"
if yournumber < 49:
print "You are truly inadequate"
else:
print "You have delusions of grandeur"
print "That's all folks"
Values
• A basic thing – a letter or a number
• Values have TYPES
• Integers 1, 29485
• Strings “Hello world”
• Float – floating point 3.14159
Variables
• A variable has a value
mynumber
Variable names
• Can’t begin with a number
• Can’t contain spaces or other funnies
• Can’t be a keyword
– Type help() and press return
– Then type keywords in the box.
Assignment
Putting a Value ‘into’ a Variable
• myVariable = 23
• myLongVariable = “Hello how’s it going”
Sometimes written with an arrow
• myVariable 23
Assignment is really a sort of COPY
Why?
Assignment quiz
• What’s the value of myVariable
myVariable = 22
mySecondVariable = 13
myVariable = mySecondVariable
myVariable = str(myVariable)
Statements
• A statement is a piece of code that
Python can execute.
• Lots of statements make a script
• Scripts are the same as programs
Operators
• Operators ‘do things’ to operands
• The simplest operators are the math
+ addition 5+2
- subtraction 5-2
* multiplication 5*2
/ division 5/2
** exponentiation 5**2
% modulo 5%2
Now we can do the first part of the Python Challenge!
A useful program
• Write a Fahrenheit to Celsius converter
• The formula for the conversion is: F = 1.8 * C + 32
• To make this program work you will need to do the
following:
Get the user input using input(“your prompt here”)
Assign the result to a variable.
• That will give you a number, but it will be in a string type.
You’ll need to convert it to an integer type using
int(variablename).
• Now you have an integer, multiply it by 1.8 and add 32
• Print the result – your answer, to the screen with
print variablename
Challenge
• Write a script/program that allows you to
input two numbers and calculates their:
– Product
– Sum
– Difference
– Quotient (one number divided by the other
without any remainder)
– Remainder (remainder when one is divided by
the other)
– Exponent (one number to the power of the other)
Challenge 2
• Create an object
• Find its type
– Print (type(myobject))
• Find its id
– Print (id(myobject))
• What is that?

More Related Content

What's hot

Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Anjali Technosoft
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codeAlgorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
hamza javed
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
Drjilesh
 
Intro To C++ - Class 10 - Control Statements: Part 2
Intro To C++ - Class 10 - Control Statements: Part 2Intro To C++ - Class 10 - Control Statements: Part 2
Intro To C++ - Class 10 - Control Statements: Part 2
Blue Elephant Consulting
 
8.2 approach in problem solving (9 hour)
8.2 approach in problem solving (9 hour)8.2 approach in problem solving (9 hour)
8.2 approach in problem solving (9 hour)
Fiqry Suryansyah
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
Samuel Igbanogu
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem
Frankie Jones
 
Ic lecture7
Ic lecture7  Ic lecture7
Ic lecture7
AttaullahRahimoon
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithm
DHANIK VIKRANT
 
Flowcharting and Algorithm
Flowcharting and Algorithm Flowcharting and Algorithm
Flowcharting and Algorithm
Zeinna Belle Desamito
 
Problem solving and design
Problem solving and designProblem solving and design
Problem solving and design
Renée Howard-Johnson
 
Penyelesaian masalah
Penyelesaian masalahPenyelesaian masalah
Penyelesaian masalah
Unit Kediaman Luar Kampus
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
Rabin BK
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithmsAlgorithms and how to write an algorithms
Algorithms and how to write an algorithms
Ahmed Nobi
 
Computer programming:Know How to Flowchart
Computer  programming:Know How to FlowchartComputer  programming:Know How to Flowchart
Computer programming:Know How to Flowchart
Angelo Tomboc
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
fika sweety
 
Intro To C++ - Class 09 - Control Statements: Part 1
Intro To C++ - Class 09 - Control Statements: Part 1Intro To C++ - Class 09 - Control Statements: Part 1
Intro To C++ - Class 09 - Control Statements: Part 1
Blue Elephant Consulting
 
Algorithm & flow chart
Algorithm & flow chartAlgorithm & flow chart
Csc 130 class 2 problem analysis and flow charts(2)
Csc 130 class 2   problem analysis and flow charts(2)Csc 130 class 2   problem analysis and flow charts(2)
Csc 130 class 2 problem analysis and flow charts(2)
Puneet narula
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and Associativity
Aakash Singh
 

What's hot (20)

Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
 
Algorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo codeAlgorithm and flowchart with pseudo code
Algorithm and flowchart with pseudo code
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
Intro To C++ - Class 10 - Control Statements: Part 2
Intro To C++ - Class 10 - Control Statements: Part 2Intro To C++ - Class 10 - Control Statements: Part 2
Intro To C++ - Class 10 - Control Statements: Part 2
 
8.2 approach in problem solving (9 hour)
8.2 approach in problem solving (9 hour)8.2 approach in problem solving (9 hour)
8.2 approach in problem solving (9 hour)
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem2.3 Apply the different types of algorithm to solve problem
2.3 Apply the different types of algorithm to solve problem
 
Ic lecture7
Ic lecture7  Ic lecture7
Ic lecture7
 
Flowchart and algorithm
Flowchart and algorithmFlowchart and algorithm
Flowchart and algorithm
 
Flowcharting and Algorithm
Flowcharting and Algorithm Flowcharting and Algorithm
Flowcharting and Algorithm
 
Problem solving and design
Problem solving and designProblem solving and design
Problem solving and design
 
Penyelesaian masalah
Penyelesaian masalahPenyelesaian masalah
Penyelesaian masalah
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Algorithms and how to write an algorithms
Algorithms and how to write an algorithmsAlgorithms and how to write an algorithms
Algorithms and how to write an algorithms
 
Computer programming:Know How to Flowchart
Computer  programming:Know How to FlowchartComputer  programming:Know How to Flowchart
Computer programming:Know How to Flowchart
 
Pseudocode algorithim flowchart
Pseudocode algorithim flowchartPseudocode algorithim flowchart
Pseudocode algorithim flowchart
 
Intro To C++ - Class 09 - Control Statements: Part 1
Intro To C++ - Class 09 - Control Statements: Part 1Intro To C++ - Class 09 - Control Statements: Part 1
Intro To C++ - Class 09 - Control Statements: Part 1
 
Algorithm & flow chart
Algorithm & flow chartAlgorithm & flow chart
Algorithm & flow chart
 
Csc 130 class 2 problem analysis and flow charts(2)
Csc 130 class 2   problem analysis and flow charts(2)Csc 130 class 2   problem analysis and flow charts(2)
Csc 130 class 2 problem analysis and flow charts(2)
 
Type Conversion, Precedence and Associativity
Type Conversion, Precedence and AssociativityType Conversion, Precedence and Associativity
Type Conversion, Precedence and Associativity
 

Similar to Python part two names and types

if, while and for in Python
if, while and for in Pythonif, while and for in Python
if, while and for in Python
PranavSB
 
Module 7
Module 7Module 7
Module 7
obrienduke
 
An Introduction To Python - Python Midterm Review
An Introduction To Python - Python Midterm ReviewAn Introduction To Python - Python Midterm Review
An Introduction To Python - Python Midterm Review
Blue Elephant Consulting
 
Function in Python
Function in PythonFunction in Python
Function in Python
Md. Shafiuzzaman Hira
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
Salahaddin University-Erbil
 
python.pdf
python.pdfpython.pdf
python.pdf
BurugollaRavi1
 
Presentation1 (1).pptx
Presentation1 (1).pptxPresentation1 (1).pptx
Presentation1 (1).pptx
BodapatiNagaeswari1
 
Ifi7184.DT lesson 2
Ifi7184.DT lesson 2Ifi7184.DT lesson 2
Ifi7184.DT lesson 2
Sónia
 
Visual Basic Review - ICA
Visual Basic Review - ICAVisual Basic Review - ICA
Visual Basic Review - ICA
emtrajano
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions
Ebad ullah Qureshi
 
Lecture # 1 introduction revision - 1
Lecture # 1   introduction  revision - 1Lecture # 1   introduction  revision - 1
Lecture # 1 introduction revision - 1
SajeelSahil
 
Thinking Like a Programmer
Thinking Like a ProgrammerThinking Like a Programmer
Thinking Like a Programmer
Cate Huston
 
Lecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in UnityLecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in Unity
Kobkrit Viriyayudhakorn
 
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
Lecture # 1 - Introduction  Revision - 1 OOPS.pptxLecture # 1 - Introduction  Revision - 1 OOPS.pptx
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
SanaullahAttariQadri
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++
Manzoor ALam
 
Core Concept_Python.pptx
Core Concept_Python.pptxCore Concept_Python.pptx
Core Concept_Python.pptx
Ashwini Raut
 
Basic elements of java
Basic elements of java Basic elements of java
Basic elements of java
Ahmad Idrees
 
Introduction to programming - class 2
Introduction to programming - class 2Introduction to programming - class 2
Introduction to programming - class 2
Paul Brebner
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
miansaad18
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
AASTHA76
 

Similar to Python part two names and types (20)

if, while and for in Python
if, while and for in Pythonif, while and for in Python
if, while and for in Python
 
Module 7
Module 7Module 7
Module 7
 
An Introduction To Python - Python Midterm Review
An Introduction To Python - Python Midterm ReviewAn Introduction To Python - Python Midterm Review
An Introduction To Python - Python Midterm Review
 
Function in Python
Function in PythonFunction in Python
Function in Python
 
C++ for beginners
C++ for beginnersC++ for beginners
C++ for beginners
 
python.pdf
python.pdfpython.pdf
python.pdf
 
Presentation1 (1).pptx
Presentation1 (1).pptxPresentation1 (1).pptx
Presentation1 (1).pptx
 
Ifi7184.DT lesson 2
Ifi7184.DT lesson 2Ifi7184.DT lesson 2
Ifi7184.DT lesson 2
 
Visual Basic Review - ICA
Visual Basic Review - ICAVisual Basic Review - ICA
Visual Basic Review - ICA
 
02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions02 Control Structures - Loops & Conditions
02 Control Structures - Loops & Conditions
 
Lecture # 1 introduction revision - 1
Lecture # 1   introduction  revision - 1Lecture # 1   introduction  revision - 1
Lecture # 1 introduction revision - 1
 
Thinking Like a Programmer
Thinking Like a ProgrammerThinking Like a Programmer
Thinking Like a Programmer
 
Lecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in UnityLecture 2: C# Programming for VR application in Unity
Lecture 2: C# Programming for VR application in Unity
 
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
Lecture # 1 - Introduction  Revision - 1 OOPS.pptxLecture # 1 - Introduction  Revision - 1 OOPS.pptx
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
 
02 functions, variables, basic input and output of c++
02   functions, variables, basic input and output of c++02   functions, variables, basic input and output of c++
02 functions, variables, basic input and output of c++
 
Core Concept_Python.pptx
Core Concept_Python.pptxCore Concept_Python.pptx
Core Concept_Python.pptx
 
Basic elements of java
Basic elements of java Basic elements of java
Basic elements of java
 
Introduction to programming - class 2
Introduction to programming - class 2Introduction to programming - class 2
Introduction to programming - class 2
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
 

More from grahamwell

Pseudocode
PseudocodePseudocode
Pseudocode
grahamwell
 
Excel =if function
Excel =if functionExcel =if function
Excel =if function
grahamwell
 
Excel Min max-average
Excel Min max-average Excel Min max-average
Excel Min max-average
grahamwell
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?
grahamwell
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
grahamwell
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
grahamwell
 
The software story
The software storyThe software story
The software story
grahamwell
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphics
grahamwell
 
Database field types
Database field typesDatabase field types
Database field types
grahamwell
 
Databases 101
Databases 101Databases 101
Databases 101
grahamwell
 
Kodu controls
Kodu controlsKodu controls
Kodu controls
grahamwell
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9
grahamwell
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your project
grahamwell
 
The rail fence
The rail fenceThe rail fence
The rail fence
grahamwell
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
grahamwell
 
Rsa encryption
Rsa encryptionRsa encryption
Rsa encryption
grahamwell
 
Server side scripts
Server side scriptsServer side scripts
Server side scripts
grahamwell
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and control
grahamwell
 
Mtslesson
MtslessonMtslesson
Mtslesson
grahamwell
 
Hashing
HashingHashing
Hashing
grahamwell
 

More from grahamwell (20)

Pseudocode
PseudocodePseudocode
Pseudocode
 
Excel =if function
Excel =if functionExcel =if function
Excel =if function
 
Excel Min max-average
Excel Min max-average Excel Min max-average
Excel Min max-average
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
 
Introduction to touch develop
Introduction to touch developIntroduction to touch develop
Introduction to touch develop
 
The software story
The software storyThe software story
The software story
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphics
 
Database field types
Database field typesDatabase field types
Database field types
 
Databases 101
Databases 101Databases 101
Databases 101
 
Kodu controls
Kodu controlsKodu controls
Kodu controls
 
Abstraction - Year 9
Abstraction - Year 9Abstraction - Year 9
Abstraction - Year 9
 
Thinking about your project
Thinking about your projectThinking about your project
Thinking about your project
 
The rail fence
The rail fenceThe rail fence
The rail fence
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
Rsa encryption
Rsa encryptionRsa encryption
Rsa encryption
 
Server side scripts
Server side scriptsServer side scripts
Server side scripts
 
Revision topic 1 sensors and control
Revision topic 1 sensors and controlRevision topic 1 sensors and control
Revision topic 1 sensors and control
 
Mtslesson
MtslessonMtslesson
Mtslesson
 
Hashing
HashingHashing
Hashing
 

Recently uploaded

[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Pitangent Analytics & Technology Solutions Pvt. Ltd
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 

Recently uploaded (20)

[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
Crafting Excellence: A Comprehensive Guide to iOS Mobile App Development Serv...
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 

Python part two names and types

  • 2. Personality Tester yournumber = input("Please enter a number between 1 and 99: ") print "You entered " , yournumber print "Performing personality analysis on your number choice …" if yournumber < 49: print "You are truly inadequate" else: print "You have delusions of grandeur" print "That's all folks"
  • 3. Values • A basic thing – a letter or a number • Values have TYPES • Integers 1, 29485 • Strings “Hello world” • Float – floating point 3.14159
  • 4. Variables • A variable has a value mynumber
  • 5. Variable names • Can’t begin with a number • Can’t contain spaces or other funnies • Can’t be a keyword – Type help() and press return – Then type keywords in the box.
  • 6. Assignment Putting a Value ‘into’ a Variable • myVariable = 23 • myLongVariable = “Hello how’s it going” Sometimes written with an arrow • myVariable 23 Assignment is really a sort of COPY Why?
  • 7. Assignment quiz • What’s the value of myVariable myVariable = 22 mySecondVariable = 13 myVariable = mySecondVariable myVariable = str(myVariable)
  • 8. Statements • A statement is a piece of code that Python can execute. • Lots of statements make a script • Scripts are the same as programs
  • 9. Operators • Operators ‘do things’ to operands • The simplest operators are the math + addition 5+2 - subtraction 5-2 * multiplication 5*2 / division 5/2 ** exponentiation 5**2 % modulo 5%2 Now we can do the first part of the Python Challenge!
  • 10. A useful program • Write a Fahrenheit to Celsius converter • The formula for the conversion is: F = 1.8 * C + 32 • To make this program work you will need to do the following: Get the user input using input(“your prompt here”) Assign the result to a variable. • That will give you a number, but it will be in a string type. You’ll need to convert it to an integer type using int(variablename). • Now you have an integer, multiply it by 1.8 and add 32 • Print the result – your answer, to the screen with print variablename
  • 11. Challenge • Write a script/program that allows you to input two numbers and calculates their: – Product – Sum – Difference – Quotient (one number divided by the other without any remainder) – Remainder (remainder when one is divided by the other) – Exponent (one number to the power of the other)
  • 12. Challenge 2 • Create an object • Find its type – Print (type(myobject)) • Find its id – Print (id(myobject)) • What is that?