Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
There are many differences. I will give a very short comparison. Python Indentation is used to separate different parts of the program, like loops, classes, functions etc. Function name: Do stuff CS Curly brackets are used to seperate different parts of the program Function name(): { Do stuff. } Python Does not need any special character to terminate a statement CS All statements are terminated using a semicolon Python You can define a function after calling it. CS You have to define a function before calling it. Python Variable types do not need to be explicitly stated answer = 5000 CS Variable types must be clearly stated. int answer = 5000 Python In python, there is a code of conduct called pep8 that is used by all python programers to ensure consistency in naming schemes and code layout. CS I don't know of such in CS. Python Comments are written with '#' for single line and tripple double quotes (""") for multi CS comments are written with // for single line and /*.... */ for multi
7th Sep 2018, 7:06 AM
Teddy Okello
Teddy Okello - avatar