#pythontips when using the ipython terminal, put a question mark after a method or class name to bring up the docstring, like:
`print?`
gives
```python
In [1]: print?
Signature: print(*args, sep=' ', end='\n', file=None, flush=False)
Docstring:
Prints the values to a stream, or to sys.stdout by default.
sep
string inserted between values, default a space.
end
string appended after the last value, default a newline.
file
a file-like object (stream); ...
```
Just published an article on @towardsdatascience about breaking #Python performance bottlenecks with aiomultiprocess!💡 Check out my practical guide filled with code examples and best practices.
https://towardsdatascience.com/supercharge-your-python-asyncio-with-aiomultiprocess-a-comprehensive-guide-571ee0e2f416
#DataScience #MachineLearning #Concurrency #PythonTips
#python #datascience #machinelearning #concurrency #pythontips
🐍 #PythonTips El método sort() ordena los elementos de una lista en orden ascendente o descendente.
Es muy útil para organizar datos y hacer búsquedas más rápidas #Python #programación
#pythontips #python #programacion
Bom dia meu povo!
Tô aproveitando as férias pra começar a mexer em algumas coisas do #Python.
Surgiu um problema. Quando faço o login e senha pelo selenium, fico preso naquela tela de https e não consigo passar adiante.
Alguma dica?
#python #mastohelp #pythontips #bolhaDev
Python quiz:
What is the output of this code?
#python #python3 #pythonprogramming #pythonquiz #pythontips
Python quiz
a. [1, 4]
[1, 4, 5]
b. [1, 4, 5]
[1, 4, 5]
c. [1, 4]
[1, 4]
#python #pythonprogramming
#pythontips #programmer #Python3 #pythonquiz
#python #pythonprogramming #pythontips #programmer #python3 #pythonquiz
🐍 "else" statement can be used in both for loops and while loops also
How does it work?
▶️ Executed only if the loop completes normally
▶️ If the loop is terminated by a "break" statement,"else" block won't be executed
Example syntax:
####
for i in range(10):
print(i)
else:
print("for loop ended without break ")
####
This will print 0 to 9 then prints the "for loop ended without break"
--
▶️ In this code snippet(of the image), we generate random number(n) between 1 to 10.
▶️ We loop through the list
▶️ If the "n" matches with the list's index,it will "break" the loop. In that case it won't execute else
▶️ If the 'n' didn't match with any index,it will execute "else"
#python #pythonprogramming #pythontips #python3
🌀What is wrong with the following python code snippet
#▪️▪️▪️
l =["c"
"py",
"js"
]
#▪️▪️▪️
We missed the comma after "c". The python will concatenate it with py. Resulting in ["cpy","js"].
#python #pythontips #pythonprogramming #python3
Simple python quiz
A. Line number 2 has invalid syntax. It should be "quiz[2]"
B. It will print ('hello', 'world')
C. Linux number 1 will give an error, we can't mix string with integer in tuple
#python #pythonprogramming
#PythonTips #pythoncoding #pythoninterviews
#python #pythonprogramming #pythontips #pythoncoding #pythoninterviews
When and how to use the python "async" feature properly? -written by @guilatrova
▶️ Async only makes sense if you're doing IO
▶️ ZERO benefit in using async to stuff like CPU intensive work
Read more about it here
https://guicommits.com/effective-python-async-like-a-pro/
#async #Python #python3 #programming
#PythonProgrammer #pythonlessons #pythontutorial #pythontips
#async #python #python3 #programming #pythonprogrammer #pythonlessons #pythontutorial #pythontips
Introduction to psutil: A Python library for system monitoring and automation
https://www.recursiveneuron.com/2022/12/introduction-to-psutil-python-library.html
#psutil #python #programming #pythonlesson #pythontips #Python3
#psutil #python #programming #pythonlesson #pythontips #python3
Since most of the resources in python need to be closed, so stop trying to close them manually. Instead, use their context manager.
#pythontips #python #python3 #coding #tips
When you're working with files use `with`
#pythontips #python #python3 #coding #tips
Learn Python Identity Operator and Difference Between “==” and “IS” Operator https://www.tecmint.com/learn-python-identity-operator/ #pythonprogramming #pythontips #python
#pythonprogramming #pythontips #python