Python ususally uses interpreter. Compiler are little bit different.
Interpret translates line by line.
Compiler takes all lines to machine code.
What is programming language? We give some instruction to translator. They tell the machine what to do. Translator can be interpreter or compiler.
Interpreter:
Compiler:
Python basics till numbers:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<span style="font-size: 14pt; font-family: arial, helvetica, sans-serif;">name=input('What is your name?') print('hellllooooo '+name) age=input("What is your age?") print('Cool you are '+age) #fundamentals data-type int float bool str list tuple set dict print(2+4) print(2-4) print(2*4) #classes custom types #specialized data types None</span> |
Double Slash in Python:
1 2 3 4 5 6 7 8 9 10 |
import math result=10/3 print(result) print(math.floor(result)) result=10//3 print(result) |
/ -> float division
//-> integer division