Message Boards Message Boards

0
|
4675 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Mathematica help

Posted 5 years ago

This is my first coding class, and I am struggling to learn to code. My professor does not teach us much beside giving us a worksheet.

I am trying to do the following (#16 on the attachment)

Construct a rule to zero all odd numbers in the list {1,2,3,4,5}.

POSTED BY: Mike Nguyen
Posted 5 years ago
{1, 2, 3, 4, 5} /. x_?OddQ -> 0

The help section of Mathematica is a wonderful resource to get acquainted with the rule-based programming.

POSTED BY: Girish Arabale
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract