questions/python/page/22
some_list[-1] is the shortest and most Pythonic. In fact, ...READ MORE
from shutil import copyfile copyfile(src, dst) Copy the ...READ MORE
There is no simple built-in string function ...READ MORE
With Python older than 2.7/3.1, that's pretty ...READ MORE
Hello @Azizjon, You can go through the example ...READ MORE
Hello @kartik, Without looking, it sounds like the ...READ MORE
The default implementation is useless (it’s hard ...READ MORE
Hello @kartik, You can do: var = 1 if type(var) ...READ MORE
Hi@Aditya, It is working fine in my python ...READ MORE
The general pattern is str.split(search).join(replacement) This used to be ...READ MORE
It seems that the problem is not ...READ MORE
Traceback (most recent call last): File "main.py", line ...READ MORE
Yep, using the static method decorator class MyClass(object): ...READ MORE
in is the intended way to test for ...READ MORE
Try hasattr(): if hasattr(a, 'property'): a.property The ...READ MORE
Hi, @Webinar, Are you getting any kind of ...READ MORE
if "ABCD" in "xxxxABCDyyyy": ...READ MORE
Here is what you asked for: from functools ...READ MORE
The SimpleHTTPServer module has been merged into http.server in Python 3.0. ...READ MORE
Classes (by default) are instances of the ...READ MORE
Python 2.7.9+ and 3.4+ Python 3.4 (released March 2014) ...READ MORE
You could use in to check if a string ...READ MORE
Hello @kartik, Basically instead of raising exception I ...READ MORE
Hello @kartik, In your model class add a ...READ MORE
Variables declared inside the class definition, but ...READ MORE
Hello @kartik, You could chain your queries as ...READ MORE
Hello @ Anee, Code: num1 = int(input("Enter First Number: ")) num2 ...READ MORE
Hello @kartik, To trigger a download you need ...READ MORE
Hello @kartik, You need to use an @api_view decorator ...READ MORE
os.remove() removes a file. os.rmdir() removes an empty directory. shutil.rmtree() deletes a ...READ MORE
Hii, Environment variables must be strings, so use os.environ["DEBUSSY"] ...READ MORE
Hello @kartik, You can use Q objects for this. They ...READ MORE
On Python ≥ 3.5, use pathlib.Path.mkdir: from pathlib import ...READ MORE
Indentation error. There should be indent before def ...READ MORE
with in: substring in string: >>> substring = "please help ...READ MORE
https://www.youtube.com/watch?v=mqaf7vj1AdA This link has the program. It uses ...READ MORE
In Python 3, you can use the sep= and end= parameters ...READ MORE
Yes. Use os.path.splitext >>> import os >>> filename, file_extension = ...READ MORE
Hi, you might have found another way ...READ MORE
can you please help me on this. ...READ MORE
>>> x = "Hello World!" >>> x[2:] 'llo World!' >>> ...READ MORE
Hi@akhtar, You can read an HDF file using ...READ MORE
Hi@akhtar, You need to use the read function in ...READ MORE
Open cmd and type the command and ...READ MORE
Hi@Ganesh, I think you are calling the wrong ...READ MORE
Hi, @There, Check what are you passing.. the ...READ MORE
try import-export library of Django or if you are ...READ MORE
Loop through the $forbiddennames array and use stripos to check if ...READ MORE
img_shape = 224 test_data = [] test_labels = [] for ...READ MORE
from collections import defaultdict a = {1: 2, ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.