Похожие чаты

I have a doubt. Is it good to use double

quotes or single quotes for string? I am learning Java also and in that we use double quotes for string. Should i use it in python too? Is it good practice?

7 ответов

8 просмотров

documentation says it dont change anything

Triple double quotes for doc strings """ Documentation """ For the code there's no real difference

Depends on the string. If the string has double quotes then it would make sense to wrap it in single quotes. And vice versa

ANDRIO- Автор вопроса
Aditya Tiwari
documentation says it dont change anything

No forget about quotes inside quotes. I'm just taking about normal strings

Single and double quotes have no difference in python, whereas in some other languages they do. Anyways if you use a linter (which you should), a common rule is to convert single quotes in simple, non-nested strings, to double quotes

Похожие вопросы

Обсуждают сегодня

Какие дистрибутивы Linux чаще всего работают в качестве серверов и почему?
Alex
27
Такс, блин, таки кто-то знает, каким образом работают макросы stdin/stdout/stderr? Я влез в stdio.h, там определения нет, отладил через асмокод - вызывается функция со странны...
The Bird of Hermes
18
Ребят, привет! Я портируюсь с войда на генту Читаю гентувики В разделе про разбивку диска указана xfs файловая система, а не ext4, как обычно Xfs имеет какие-то преимущества ...
Андрей Дыбов
21
А кто-то пробовал, уезжая из Эстонии получить э-рез и продолжить вести предпринимательскую деятельность внутри Эстонии, используя свой OÜ?
Lalalashechki Lalala
62
я не магистр хаскеля, но разве не может лейзи тип конвертнуться в не-лейзи запросив вычисление содержимого прям при инициализации?
deadgnom32 λ madao
100
Lol is just wrote a long text about tokenomics etc and it was directly deleted, no curses or similar so i write it again in shorter. Hey Ben 600m eco system tokens, around 30...
. Duss
3
can anyone here tell me the exact liqudation % when i supplied 100 usdt and borrowed bnb with borrow limit used 66.21 % ? usually bnb borrow limit is 80% and i guess 85 ...
jacky chan
9
Is Kadena onto something special? No one really knows. Good luck!
Bright Uncle Stephen EqualBet
40
Всем привет, на линуксе лучше на fasm или nasm учиться писать для начала ?
meszjol
14
I'm new at Monero and I'd like to ask you all - why are you in Monero? I know about privacy but what do you expect to happen in the next years, decades that Monero will make i...
Konrad
19
Карта сайта