Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Functions and Looping Functions

Brenda Ramirez
Brenda Ramirez
557 Points

Types of paramenters

Are there "types of parameters" that define what arguments can be passed into a function when it is called. For example, this function can be called using a line of code like yell("You are doing great"). But would the use of the word "text" as a parameter control what arguments the person calling the function can pass in? Calling this function while passing an integer as an argument produces error messages. So do types of parameters exist? def yell(text): text = text.upper() number_of_characters = len(text) result = text + "!" * (number_of_characters // 4) print (result)

1 Answer

Python isn't strongly typed, so types can be more dynamic. No, you can't force parameters to be of a specific type, but in newer versions of Python, you can "hint" Python that parameters should be a specific type.