How make a comment in python code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How make a comment in python code?

How can I make a comment in Python code?

2nd Sep 2017, 12:49 PM
Martin Wetter
Martin Wetter - avatar
14 Answers
+ 4
#Your slowly performance Comment! and muti """ Your More Slower performance Comment! """
2nd Sep 2017, 12:50 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
@Martin "+" to "," bc python didn't make handler for concatenate between number and string
2nd Sep 2017, 12:59 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
print("Vysledek je " , result) + to , all lines
2nd Sep 2017, 1:08 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
Jede to, i opakovaně, problém je, že když tam nedáš ukončit tak to vyhodí chybu, protože to nemá správný vstup, respektive žádný vstup. secist 15 15 ukoncit Musí zadat tohle může být i secist 15 15 odecist 15 14 ale tu musí být to ukončit aby to breaklo jinak to nemá správný vstup důsledkem toho while na začátku.
2nd Sep 2017, 1:30 PM
AutomatedpROCESSES
AutomatedpROCESSES - avatar
+ 2
# single line comment """ multiple line comment """
2nd Sep 2017, 12:53 PM
AutomatedpROCESSES
AutomatedpROCESSES - avatar
+ 2
Or you can transfer result that is int into string like this: str(result) and use +.
2nd Sep 2017, 1:08 PM
AutomatedpROCESSES
AutomatedpROCESSES - avatar
+ 2
Oni si nevšimli, že ty to result převádíš rovnou do String a nebo si to v reakci na ně upravil. Když tak to uveď do komentáře na začátek kódu, že musí nakonec uvést ukoncit, tedy přesnou formu vstupu jim tam uveď.
2nd Sep 2017, 1:32 PM
AutomatedpROCESSES
AutomatedpROCESSES - avatar
+ 2
Anebo to jde řešit obdobou hasNext z Java. To je na Dylan to už sem psát nebudu.
2nd Sep 2017, 1:34 PM
AutomatedpROCESSES
AutomatedpROCESSES - avatar
+ 1
# Like this for single line ''' Like this for multi-line ''' You can use """ instead of ''' if you want https://www.python.org/dev/peps/pep-0008/#comments
2nd Sep 2017, 12:56 PM
David Ashton
David Ashton - avatar
0
thanks man 👍
2nd Sep 2017, 12:52 PM
Martin Wetter
Martin Wetter - avatar
0
already knew it 👍but another question is why this program doesn't work properly? https://code.sololearn.com/caxZJ5ADR2Q8/?ref=app
2nd Sep 2017, 12:56 PM
Martin Wetter
Martin Wetter - avatar
0
I didn't understand?
2nd Sep 2017, 1:05 PM
Martin Wetter
Martin Wetter - avatar
0
@michal halaska you're a Czech, aren't you? It could be easier to speak to each other in Czech? takže kde přesně mám chybu v programu? 😉
2nd Sep 2017, 1:11 PM
Martin Wetter
Martin Wetter - avatar
0
tohle je kalkulačka přímo z kurzu, opsaná bo tam není celý kód jen části, tak jsem ji chtěl vyzkoušet ale ještě ji předělán bo mi nesedí svou strukturou
2nd Sep 2017, 1:36 PM
Martin Wetter
Martin Wetter - avatar