[Tutor] tutoring

Alan Gauld alan.gauld at yahoo.co.uk
Tue Nov 26 18:19:08 EST 2019


On 26/11/2019 18:57, Angel Abad wrote:
> hello, i was wondering if i could get help with my homework?

We will offer suggestions but we won't do it for you...

> this is the examples that was given in class that i don't seem to
> understand how to do.

What exactly don't you understand? You need to be specific if
you want specific answers.

Did you try it and it didn't work?
If so show us your code plus any error messages(in full)

> 
> ###TODO 1: Convert this to a function that takes a string as ###input

Do you know how to define a function that takes an input value?

> ### (i.e., the string to print, "Welcome..." in this example)
> ### and prints the string with the border.  

Do you know how to print a string with border?
The code below is a pretty strong hint!

> The function should ### not return anything.  

Do you know how to write a function that does not return anything?

> (Optional: take the border character to print

Let's leave the border and other stuff till later.
Focus on one problem at a time...

> print("=" * 50)
> print("Welcome to the GeoCalc program!")
> print("=" * 50)

So can you put those three lines into a function that
takes an input and returns nothing. Lets call it: print_welcome?

So I should call it as

print_welcome("Hello there!")

and it should print out

=======================================================
Hello there!
=======================================================

Show us your best attempt and tell us what went wrong.
Include any error messages in full.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list