t_03.4up - Engineering Computation: Tutorial 03 Problem...

Info iconThis preview shows pages 1–4. 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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Engineering Computation: Tutorial 03 Problem Solving with Computing, using the Python Language January 21, 2011 Questions from Week 02? Programming Exercises from Zelle textbook 1 Pg. 72-74 # 1, 5, 8, 12, 13. 2 What’s in your toolbox? 1 Print statement, string literals 2 Basic calculator, integer division 3 Variables 4 Built-in functions 5 Math library functions 6 Straight-line (non-branching) programs 7 Branching programs 8 Python lists 9 For loops 10 Nested for loops 11 Strings 3 Today’s Topics: 1 More built-in functions: bin() hex() oct() 2 Python as Graphing Calculator (matplotlib) 4 video Converting decimal to binary video Converting decimal to hexadecimal 5 Converting between number systems using Python Let’s take the decimal number 17: decimal to binary >>> bin (17) ’0b10001 ’ decimal to hexadecimal >>> hex (17) ’0x11 ’ decimal to octal >>> oct (17) ’ 021 ’ 6 video Converting binary to decimal video Converting hexadecimal to decimal 7 Converting between number systems using Python to decimal >>> i n t (0 b10001 ) #from binary 17 >>> i n t (0 x11 ) #from hexadecimal 17 >>> i n t (021) #from o c t a l 17 hexadecimal to binary >>> bin (0 x11 ) ’0b10001 ’ 8 Matplotlib In order to be able to reproduce the examples in this tutorial...
View Full Document

This document was uploaded on 09/14/2011.

Page1 / 7

t_03.4up - Engineering Computation: Tutorial 03 Problem...

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

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