You are on page 1of 2

tutorial

Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license()" for more information.
>>> print ('hellow world")
SyntaxError: EOL while scanning string literal
>>> print("helloworld")
helloworld
>>> 5+100
105
>>> -23-23
-46
>>> -23+23
0
>>> 21/23
0.9130434782608695
>>> int(21/23)
0
>>> 21//12
1
>>> float(21/23)
0.9130434782608695
>>> 54577979*7868877
429467403659583
>>> exp(2*2*2)
Traceback (most recent call last):
File "<pyshell#10>", line 1, in <module>
exp(2*2*2)
NameError: name 'exp' is not defined
>>> 2**12
4096
>>> 2*2+8
12
>>> pemdas
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
pemdas
NameError: name 'pemdas' is not defined
>>> myVariable = 30
>>> myvariable
Traceback (most recent call last):
File "<pyshell#15>", line 1, in <module>
myvariable
NameError: name 'myvariable' is not defined
>>> myVariable
30
>>> 30
30
>>> myVariable+20200202
20200232
>>> value=input("enter")
enter45
>>> value
'45'
>>> value+76
Traceback (most recent call last):
File "<pyshell#21>", line 1, in <module>
value+76
TypeError: must be str, not int
>>> value=int(input("enter"))
enter89
>>> value
89
Page 1
tutorial
>>> value+76
165
>>> pow(2,3)
8
>>> pow(5453,87)
122261099964722118010609251155124359469538067853172113197882775818765332329200087892
449944700260424130636921309746045692219879846294851668168691946471647153280405363438
848299348571046764378586273031679131881064699813895786679983342071984449118438607820
55314071806960065800854886903723987685169581027494698273550237493001051237
>>> dir(__builtins__)
['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException',
'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning',
'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError',
'ConnectionRefusedError', 'ConnectionResetError', 'DeprecationWarning', 'EOFError',
'Ellipsis', 'EnvironmentError', 'Exception', 'False', 'FileExistsError',
'FileNotFoundError', 'FloatingPointError', 'FutureWarning', 'GeneratorExit',
'IOError', 'ImportError', 'ImportWarning', 'IndentationError', 'IndexError',
'InterruptedError', 'IsADirectoryError', 'KeyError', 'KeyboardInterrupt',
'LookupError', 'MemoryError', 'ModuleNotFoundError', 'NameError', 'None',
'NotADirectoryError', 'NotImplemented', 'NotImplementedError', 'OSError',
'OverflowError', 'PendingDeprecationWarning', 'PermissionError',
'ProcessLookupError', 'RecursionError', 'ReferenceError', 'ResourceWarning',
'RuntimeError', 'RuntimeWarning', 'StopAsyncIteration', 'StopIteration',
'SyntaxError', 'SyntaxWarning', 'SystemError', 'SystemExit', 'TabError',
'TimeoutError', 'True', 'TypeError', 'UnboundLocalError', 'UnicodeDecodeError',
'UnicodeEncodeError', 'UnicodeError', 'UnicodeTranslateError', 'UnicodeWarning',
'UserWarning', 'ValueError', 'Warning', 'WindowsError', 'ZeroDivisionError', '_',
'__build_class__', '__debug__', '__doc__', '__import__', '__loader__', '__name__',
'__package__', '__spec__', 'abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray',
'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright',
'credits', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit',
'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash',
'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len',
'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object',
'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr',
'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod', 'str',
'sum', 'super', 'tuple', 'type', 'vars', 'zip']
>>> abs(12.7675)
12.7675
>>> help(hash)
Help on built-in function hash in module builtins:

hash(obj, /)
Return the hash value for the given object.
Two objects that compare equal must also have the same hash value, but the
reverse is not necessarily true.

>>> max(5,76,76)
76
>>> import math
>>> math.sqrt(24)
4.898979485566356
>>> dir(__module__)
Traceback (most recent call last):
File "<pyshell#33>", line 1, in <module>
dir(__module__)
NameError: name '__module__' is not defined
>>> squareRoot=math.sqrt
>>> squareRoot(65)
8.06225774829855
>>>

Page 2

You might also like