Skip to content

Instantly share code, notes, and snippets.

@LuisDAlfaro
Created September 2, 2020 02:58
Show Gist options
  • Save LuisDAlfaro/c6c5ae0d126a17690d70eed7bcd7d5e4 to your computer and use it in GitHub Desktop.
Save LuisDAlfaro/c6c5ae0d126a17690d70eed7bcd7d5e4 to your computer and use it in GitHub Desktop.
/usr/local/bin/python3.8 "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevconsole.py" --mode=client --port=62510
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/Users/lalfaro/Library/Mobile Documents/com~apple~CloudDocs/CursoPythonICAI'])
PyDev console: starting.
Python 3.8.5 (v3.8.5:580fbb018f, Jul 20 2020, 12:11:27)
[Clang 6.0 (clang-600.0.57)] on darwin
>>> 10==9
False
>>> 10¡=9
File "<input>", line 1
10¡=9
^
SyntaxError: invalid character in identifier
>>> 10!=9
True
>>> 8<<2
32
>>> 4<<2
16
>>> 4>>2
1
>>> 8>>2
2
>>> a = 10
... a +=1
>>> a = 10
>>> a +=1
>>> a
11
>>> a = 10
>>> a +=1
>>> b = 7
>>> a +=b
>>> a
18
>>> 01^0
File "<input>", line 1
01^0
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
>>> 11^0
11
>>> print(var:=var +1)
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'var' is not defined
>>> print(var2 :=var +1)
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'var' is not defined
>>> print(var2 := var +1)
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'var' is not defined
>>> var = 10
>>> print(var2 := var +1)
11
>>> print(var2 := var +1)
11
>>> max?
File "<input>", line 1
max?
^
SyntaxError: invalid syntax
>>> max
<built-in function max>
>>> max(help)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: '_Helper' object is not iterable
>>> max?
File "<input>", line 1
max?
^
SyntaxError: invalid syntax
>>> max
<built-in function max>
>>> max(help)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: '_Helper' object is not iterable
>>> ?max
File "<input>", line 1
?max
^
SyntaxError: invalid syntax
>>> a = ['a','b,','c']
>>> max(a)
'c'
>>> a = ['a','b,','z']
>>> max(a)
'z'
>>>
>>> max(a)
'z'
>>> a = ['a','b,','z']
>>> a = ['a','b,','z']
>>> a = ['a','b,','z']
>>> a = ['a','b,','z']
>>> a = ['a','b,','z']
>>> a = ['a','b,','z']
>>> max(a)
'z'
>>> data = ['data',50,91.1,(2011,11,21)]
>>> data
['data', 50, 91.1, (2011, 11, 21)]
>>> name,shares,price,date = data
>>> data
['data', 50, 91.1, (2011, 11, 21)]
>>> _,shares,prices,_= data
>>> data
['data', 50, 91.1, (2011, 11, 21)]
>>> name, *more = data
>>> data
['data', 50, 91.1, (2011, 11, 21)]
>>> name, *_, (*_, dia) = data
>>> data
['data', 50, 91.1, (2011, 11, 21)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment