Use a list comprehension to display the numbers from 1 through 30 inclusive that are divisible by 3.

What will be an ideal response?


>>> [n for n in range(1,31) if n % 3 == 0]
[3, 6, 9, 12, 15, 18, 21, 24, 27, 30]

Computer Science & Information Technology

You might also like to view...

When writing a business letter, use the colon character to follow the complimentary closing

Indicate whether the statement is true or false

Computer Science & Information Technology

A(n) ____ color scheme uses different shades of a single color.

a. monochromatic b. analogous c. gradient d. complementary

Computer Science & Information Technology

A productivity software suite including a set of software applications, each one specializing in a particular type of output.

What will be an ideal response?

Computer Science & Information Technology

An employee in the accounting department recently received a phishing email that instructed them to click a link in the email to view an important message from the IRS which threatened penalties if a response was not received by the end of the business day. The employee clicked on the link and the machine was infected with malware. Which of the following principles BEST describes why this social engineering ploy was successful?

A. Scarcity B. Familiarity C. Social proof D. Urgency

Computer Science & Information Technology