# Python Function

**URL:** <https://forum.networklessons.com/t/python-function/10592>\
**Category:** Lessons Discussion\
**Created:** [April 6, 2020, 5:51pm UTC](https://forum.networklessons.com/t/python-function/10592 "2020-04-06T17:51:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReneMolenaar](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/renemolenaar/32/488_2.png) [@ReneMolenaar](https://forum.networklessons.com/u/ReneMolenaar)\
**Post date:** [April 6, 2020, 5:51pm UTC](https://forum.networklessons.com/t/python-function/10592/1 "2020-04-06T17:51:30Z")

</div>

This topic is to discuss the following lesson:

> **[Python Function](https://networklessons.com/python/python-function)**
>
> Python Functions only run when you call them. Functions help to reduce redundant code and can accept or return data. This lesson explains everything.

---

<div class="post-metadata">

**Author:** ![diego.mv1987](https://cdn-forum.networklessons.com/letter_avatar_proxy/v4/letter/d/85f322/32.png) [@diego.mv1987](https://forum.networklessons.com/u/diego.mv1987)\
**Post date:** [June 5, 2021, 3:41am UTC](https://forum.networklessons.com/t/python-function/10592/2 "2021-06-05T03:41:46Z")

</div>

I think it will be easier if you just use print(“Connecting to device”, device\_name, “initiated”)  
I think the %s % is not used anymore.

---

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [June 8, 2021, 5:22am UTC](https://forum.networklessons.com/t/python-function/10592/3 "2021-06-08T05:22:13Z")

</div>

Hello Diego

Yes, for Python 3, and later back-ported to Python 2.7, it is possible to do a more “regular” formatting of strings rather than using the %s format. This is considered the “new style” compared to the use of the % operator.

Thanks for sharing!

Laz
