Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 6 - Functions - Programming Exercises - Page 205: 6.12

Answer

code

Work Step by Step

# 6.12 (Display characters) Write a function that prints characters using the following # header: # def printChars(ch1, ch2, numberPerLine): # This function prints the characters between ch1 and ch2 with the specified # numbers per line. Write a test program that prints ten characters per line from 1 # to Z. def printChars(ch1, ch2, numberPerLine): count = 1 for i in range(ord(ch1), ord(ch2)+1): print(chr(i), end=" ") if count % numberPerLine == 0: print() count += 1 printChars("1", "z", 10)
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.