Select language
Română
English
Français
Deutsch
Italiano
Español
Home
Languages ▾
CPP
C
CS
GO
JAVA
Python
Html
JS
CSS
PHP
Hard Lessons ▾
Hard Lesson 1
Hard Lesson 2
Hard Lesson 3
Hard Lesson 4
Hard Lesson 5
Hard Lesson 6
Hard Lesson 7
Hard Lesson 8
Hard Lesson 9
Hard Lesson 10
Hard Lesson 11
Hard Lesson 12
Compiler
Account
Python
Example
n = int(input("Input: ")) print("You entered:", n) OUTPUT: Input: 5 You entered: 5
Variables
# No explicit types, dynamic typing x = 100 # int y = 5.67 # float z = "Hello" # str c = 'A' # str (1 character) b = True # bool d = None # null/void # Type check: type(x)
Input
number = int(input("Enter number: ")) print("Number:", number) character = input("Enter character: ")[0] print("Character:", character)
Output
print("text") print(variable) print("Line1\nLine2") # New line print("Tab\tHere") # Tab print(chr(65)) # Outputs: A print("Multiple", "items", 123)
Comments
# This is a single-line comment ''' This is a multi-line comment Using triple quotes '''
Functions
def add(a, b): return a + b # Usage: result = add(5, 3) print(result) def greet(name): print("Hello", name) # No return = void