Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with phyton Define a function called showAlphabet(). a. This function prints the alphabet in both uppercase and lowercase as follows: A B

I need help with phyton

Define a function called showAlphabet().

a. This function prints the alphabet in both uppercase and lowercase as follows:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

a b c d e f g h i j k l m n o p q r s t u v w x y z

b. For full credits, your function should use all the following python features:

The for loops;

The chr() function;

The sys.stdout.write() function;

The str(x).ljust(2) function;

The ascii code for A is 65;

The asscii code for a is 97.

Define a function called drawTarget(radius).

a. The input to this function is an integer called radius.

b. This function reports the following error of radius is less than 4:

Radius must be at least 4.

c. When radius is at least 4, this function displays a target on the screen. Both the height and the width of the target are (radius*2+1).

The center of this target is at coordinate (radius, radius).

The distance of a pixel is computed as its Euclidean distance from the center.

If a pixel falls in the range of (radius/2.0

(distance

Otherwise, the pixel is displayed as two dots ...

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

ISBN: 0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago