ChatCrawlerпоиск по публичному Telegram Открыть приложение
3

30 Days Of Python

5 июля 2024
2024-07-05×
5 июля 2024
👨
Hi everyone. I hope everyone is doing well. Thanks @neodynamics and @fisiha1224 for answering my question. I'm back with another question today. When I typed in "print(1 is 1)" to the python shell, it returned "True". But it also diplayed above it, "<stdin>:1: SyntaxWarning: "is" with 'int' literal. Did you mean "=="?" I'm curious why it displayed this message. Thanks
👨🏾‍💻Hi everyone. I hope everyone is doing well. Thanks @neodynamics and @fisiha1224 for answering my question. I'm back with another question today. When I typed in "print(1 is 1)" to the python shell, it returned "True". But it also diplayed above it, "<stdin>:1: SyntaxWarning: "is" with 'int' literal.
The "is" keyword is used to compare if two objects are the same. The interpreter is just warning you because there's no need to compare integers by their objects, since 1 will always be 1 irrespective of where it is used and no two different integers can be the same object. So it's just asking you if you wanted to use the equality sign since that's what you should normally use to compare integers
B
Benjamin FarunaThe "is" keyword is used to compare if two objects are the same. The interpreter is just warning you because there's no need to compare integers by their objects, since 1 will always be 1 irrespective of where it is used and no two different integers can be the same object. So it's just asking you
You can try using the "id" keyword to check the object id of those integers and compare it to how it works on lists and sets. Two lists can contain the same elements and they're different objects, but that's not the case with immutable data types
A
Hello, My name is Michael, I'm from Sierra Leone. I'm new here and I'm an absolute beginner.
A
Same here, we are beginners aiming to become comfortable with this language and programming. We may have very different study field or occupations but our passion drives us in a same community! Good Luck to all of us! 😁👍
Hey, how are u? @asabeneh I'm from Brazil and I would like to create a session so I can translate the repository into Portuguese, because here in Brazil there are a lot of people who don't know English and I think your repository would have a greater reach and help more people on their journey of learning English. python, I am available to do the translation, I am an enthusiast of your idea of ​​the 30 day python challenge. I will do part of the translation per day so as not to overwhelm myself and add the translated readmes gradually, I will follow the original folder structure that you created but translated and in the directory that I will call Portuguese.
I
Okay, I translated day 1, review it and merge it if you can.
Календарь: июль 2024
Архив по месяцам
Открыть в Telegram Каталог площадок Искать в ChatCrawler

Слепок открытой публичной ленты из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Чего мы не делаем · Убрать страницу из выдачи · Каталог