Example
Functions with Parameters
Parameters allow passing data to functions. Functions become more flexible.
Showing 41–50 of 73
Example
Parameters allow passing data to functions. Functions become more flexible.
Example
Tuples are immutable lists. Once created, they cannot be modified.
Example
Tuples have only two methods: count() for counting and index() for searching.
Article Python Fundamentals
…Control says: "All systems go!"') # Using different quote types print('Captain\'s log: Day 1') # Using backslash to escape single quote # Including special characters print("Temperature…
Example
Function can return multiple values as a tuple. Unpacking on assignment.
Example
Functions enumerate() and range() extend for loop capabilities in Python.
Example
When to use tuples instead of lists? Comparison of properties and applications.
Example
Learning to import modules in Python. Modules extend your program capabilities.
Challenge
Clean the crew sign-ups for the analogue mission: trim and capitalise names, lower-case emails, then reject sign-ups with no name or a broken email and drop duplicates by email, saying why for each…
Article Python Fundamentals
…Every example below runs as it is. Open the editor and type along rather than just reading. Typing the code yourself sticks far better, and you'll make a few typos that teach you more than the article…