{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

t_03.4up

# t_03.4up - Questions from Week 02 Engineering Computation...

This preview shows pages 1–4. Sign up to view the full content.

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

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

View Full Document
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 b i n a r y 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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}