01_slide_presentation[1] - Engineering Computation:...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Engineering Computation: Tutorial 01 Problem Solving with Computing, using the Python Language Questions from Week 00? Programming Exercises from Zelle textbook 1 pg. 22 # 1 2 pg. 23 # 2- 5 (you will need to have read Chapter 1 to attempt these). 2 Friendly note: practice, practice, practice ... You learn to drive by driving. 3 Friendly note: practice, practice, practice ... You learn to drive by driving. You learn to play the guitar by playing the guitar. 3 Friendly note: practice, practice, practice ... You learn to drive by driving. You learn to play the guitar by playing the guitar. You learn to play hockey by playing hockey. 3 Friendly note: practice, practice, practice ... You learn to drive by driving. You learn to play the guitar by playing the guitar. You learn to play hockey by playing hockey. You learn to program by programming. So try not to spend all your time driving, playing guitar and playing hockey. Make some room for Python :-) 3 During the teaching session, you should start IDLE and try to replicate the code samples. Quick Review Calculate 14.0 to the 6th power. 4 Whats in your toolbox? 1 Python print statement 2 String literals 3 Basic calculator 4 Integer division 5 Todays Topics: 1 Variables 2 Variable types 3 Assigning values to variables 4 Some built in functions: type() id() str() int() float() abs() round() range() 5 Some math library functions 6 Straight-line (non-branching) programs. 7 Introduction to conditionals (branching programs) 6 Variables Introduction to Program Variables: jarmodel need to calculate values that represent physical entities like: velocity acceleration time other data items manipulate and store data. a variable is bound to a value as if saying this is x. >>> x = 5 >>> 7 How to name Variables Variable naming conventions 1 Variable names cannot start with a number. 8 How to name Variables Variable naming conventions 1 Variable names cannot start with a number. 2 Extremely short or very long variable names can be hard to work with in certain contexts. 3 Use names of an appropriate length that are meaningful . For example: 8 How to name Variables Variable naming conventions 1 Variable names cannot start with a number. 2 Extremely short or very long variable names can be hard to work with in certain contexts. 3 Use names of an appropriate length that are meaningful . For example: thisIsMyVeryLongNameForAVariable = "bad" , would be annoying. 8 How to name Variables Variable naming conventions 1 Variable names cannot start with a number. 2 Extremely short or very long variable names can be hard to work with in certain contexts. 3 Use names of an appropriate length that are meaningful . For example: thisIsMyVeryLongNameForAVariable = "bad" , would be annoying....
View Full Document

Page1 / 130

01_slide_presentation[1] - Engineering Computation:...

This preview shows document pages 1 - 15. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online