2.18. Chapter AssessmentΒΆ

Check your understanding

There is a function we are providing in for you in this problem called square. It takes one integer and returns the square of that integer value. Write code to assign a variable called xyz the value 5*5 (five squared). Use the square function, rather than just multiplying with *.

Write code to assign the number of characters in the string rv to a variable num_chars.

(This is not an assessment question) The code below defines functions used by one of the questions above. Do not modify the code, but feel free to take a look.

Before you keep reading...

Making great stuff takes time and $$. If you appreciate the book you are reading now and want to keep quality materials free for other students please consider a donation to Runestone Academy. We ask that you consider a $10 donation, but if you can give more thats great, if $10 is too much for your budget we would be happy with whatever you can afford as a show of support.

You have attempted 1 of 5 activities on this page