Skip to main content
The 2024 Developer Survey results are live! See the results
Sven Marnach's user avatar
Sven Marnach's user avatar
Sven Marnach's user avatar
Sven Marnach
Staff Site Reliability Engineer at Mozilla
  • Member for 14 years, 5 months
  • Last seen this week
4655 votes
Accepted

How can I remove a key from a Python dictionary?

1577 votes

How to check if type of a variable is string?

1554 votes

How to set environment variables in Python?

1471 votes
Accepted

How can I open multiple files using "with open" in Python?

1370 votes
Accepted

How to check if a string is a substring of items in a list of strings

1201 votes
Accepted

Split string on whitespace in Python

1109 votes
Accepted

Python datetime to string without microsecond component

963 votes
Accepted

Get name of current script in Python

923 votes
Accepted

Why do we check up to the square root of a number to determine if the number is prime?

880 votes
Accepted

Collections.defaultdict difference with normal dict

869 votes
Accepted

How to find all occurrences of an element in a list

709 votes
Accepted

How to format a floating number to fixed width in Python

646 votes
Accepted

Take the content of a list and append it to another list

607 votes
Accepted

Check if item is in an array / list

570 votes
Accepted

Getting a hidden password input

533 votes
Accepted

Is there a difference between "pass" and "continue" in a for loop in Python?

513 votes
Accepted

How to ignore xargs commands if stdin input is empty?

511 votes
Accepted

Remove the first character of a string

474 votes
Accepted

How to pick just one item from a generator?

454 votes
Accepted

What's the difference between `raw_input()` and `input()` in Python 3?

437 votes
Accepted

Is there a Python equivalent to Ruby's string interpolation?

419 votes
Accepted

What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)?

386 votes
Accepted

ValueError: setting an array element with a sequence

371 votes
Accepted

Dynamic instantiation from string name of a class in dynamically imported module?

349 votes

How to use timeit module

349 votes
Accepted

How do I convert hex to decimal in Python?

325 votes
Accepted

What is the difference between an expression and a statement in Python?

325 votes
Accepted

List of tuples to dictionary

318 votes
Accepted

How can I create a copy of an object in Python?

307 votes
Accepted

Printing Lists as Tabular Data

1
2 3 4 5
87