Presentation is loading. Please wait.

Presentation is loading. Please wait.

Python 6 Mr. Husch.

Similar presentations


Presentation on theme: "Python 6 Mr. Husch."— Presentation transcript:

1 Python 6 Mr. Husch

2 Objective Practice more lines of code KEEP DOING YOUR ERROR LOG

3 What does the % sign do in the code we are about to look at?
Format Symbol Conversion %c character %s string conversion via str() prior to formatting %i signed decimal integer %d %u unsigned decimal integer %o octal integer %x hexadecimal integer (lowercase letters) %X hexadecimal integer (UPPERcase letters) %e exponential notation (with lowercase 'e') %E exponential notation (with UPPERcase 'E') %f floating point real number %g the shorter of %f and %e %G the shorter of %f and %E %r is not on that chart, why not? %r is an unambiguous string, something that may need to change formats as it is reading. Traditionally you would use %s for a string, but if %s is not defined it will allow you to use %r in place of it. I do not know why this lesson wants us to use %r instead of %s, both should work the same with one difference in the final run code.

4 Enter the following code: Save as Lastname_python6

5 Questions: Answer in your Journal For Question 3 you will need to edit the code.
1) What changes from the code to the display in the one, two, three, four sequence? 2) What are parentheses used for in this code? 3) What changes to the code if you switch %r to %s? Log any errors and do not repeat them next time

6 We now have a little baseline, for the rest of class work on the following website.


Download ppt "Python 6 Mr. Husch."

Similar presentations


Ads by Google