---
title: "Discussion on \"Trailing commas in python\" | Hashnode"
description: "Discussion on \"Trailing commas in python\". This has tripped me off way more than I would like. For those of you who don't know adding a comma makes a variable into tuple (Yes its not the C bracket)\nfoo = 1,\nprint(type(foo))\n\nIt prints:\n<class 'tuple'>"
url: "https://hashnode.com/posts/trailing-commas-in-python/5f37e59dc4d5973f55c907a7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Trailing commas in python](https://rahem027.hashnode.dev/trailing-commas-in-python?utm_source=hashnode&utm_medium=feed)

This has tripped me off way more than I would like. For those of you who don't know adding a comma makes a variable into tuple (Yes its not the C bracket) foo = 1, print(type(foo)) It prints: <class 'tuple'>

Aug 15, 2020 · 1 min read · rahem027.hashnode.dev  
Read the article

## Written by

[Hemil Ruparel](https://hashnode.com/@rahem027)

@rahem027

  
[View profile](https://hashnode.com/@rahem027)

Would love to help you

## Responses 1

Markdown supported · ⌘↵ to post

[Sean Charles](https://hashnode.com/@emacstheviking)

[Aug 15, 2020](https://hashnode.com/posts/trailing-commas-in-python/5f37e59dc4d5973f55c907a7/comment/5f37f365c4d5973f55c9087c)

It's always good to know about the different notation types: infix, postfix and prefix. Then, it's good to know how and when your language of choice decides to enforce them! Extending your example in 3.6 at the REPL confuses me more!

```
>>> foo = 1,
>>> print(type(foo))
<class 'tuple'>
>>> print(type(1,))
<class 'int'>
```

[Hemil Ruparel](https://hashnode.com/@rahem027)

[Aug 15, 2020](https://hashnode.com/posts/trailing-commas-in-python/5f37e59dc4d5973f55c907a7/comment/5f37f365c4d5973f55c9087c#reply-5f37f4df0801bf3f76e5f61b)

I understand infix, prefix and postfix though I dont know what exactly python does. And BTW i tried both. And it confused me more too. I will add this too 😁😁😁
