For some reason these are different:
pattern = r'[0-9]{4,6}'
And
pattern2 = r'[0-9][0-9][0-9][0-9]([0-9]){0,2}'
And when I try to match them
import re
re.search(pattern, '1234')
and
import re
re.search(pattern2, '1234')
are different. Help?
--
https://mail.python.org/mailman/listinfo/pytho
For some reason, if you put in the code
def odd_ones_out(numbers):
for num in numbers:
count = numbers.count(num)
if not count % 2 == 0:
for i in range(count):
numbers.remove(num)
return numbers
nums = [72, 4, 82, 67, 67]
print(odd_ones_out(nums
How do you change the color of the bar in pygal?
I want to change it from red to blue. Help!
--
https://mail.python.org/mailman/listinfo/python-list
Are there any good editors on Apple that don't cost money and already has
matplotlib, numpy, and other modules already installed?
--
https://mail.python.org/mailman/listinfo/python-list
How do you replace a variable with its value in python 3.7.2? For example, say
I have:
dinner = {'Starters':['Fried Calamari', 'Potted crab'],'Main Course':['Fish',
'Meat'], 'Desert':['Cake', 'Banana Split']}
# Don't ask where I got the dinner from
for meal in dinner.keys():
meal = l
How do you replace a variable with its value in python 3.7.2? For example, say
I have:
dinner = {'Starters':['Fried Calamari', 'Potted crab'],'Main Course':['Fish',
'Meat'], 'Desert':['Cake', 'Banana Split']}
# Don't ask where I got the dinner from
for meal in dinner.keys():
meal = lis
On Wednesday, June 26, 2019, at 7:44:15 AM UTC-4, Cecil Westerhof wrote:
> I need to write a desktop program. I choose to use tkinter. How can I
> make sure the window title is visible? For example when I have the
> following code:
> from tkinter import Button, filedialog, Label, messagebo
How do you insert an item into a dictionary? For example, I make a dictionary
called "dictionary".
dictionary = {1: 'value1', 2: 'value3'}
What if I wanted to add a value2 in the middle of value1 and value3?
--
https://mail.python.org/mailman/listinfo/python-list
I tried doing a list comprehension. I typed:
favorite_fruits = ['watermelon', 'blackberries']
print(fruit for fruit in favorite_fruits)
And I got:
at 0x0402C7B0>
What does this mean and what do I have to fix?
--
https://mail.python.org/mailman/listinfo/python-list
What is a, b, c, and d in:
from tkinter import *
window = Tk()
drawing = Canvas(window, height=500, width=500)
rectangle = drawing.create_rectangle(a, b, c, d)
and:
circle = drawing.create_oval(a, b, c, d)
???
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, March 20, 2019, at 7:34:53 PM UTC-4, CrazyVideoGamez wrote:
> So, I typed in code:
> from turtle import *
> forward(100)
> right(120)
> clear()
> It didn't work! It kept on saying that there was an indent and the first line
> was wrong. Help!
wait no
On Wednesday, March 20, 2019 at 8:29:42 PM UTC-4, MRAB wrote:
> On 2019-03-21 00:12, DL Neil wrote:
> > Jason,
> >
> > On 21/03/19 12:34 PM, jasonanyil...@gmail.com wrote:
> >> So, I typed in code:
> >> from turtle import *
> >> forward(100)
> >> right(120)
> >> clear()
> >> It didn't work! It kep
On Monday, March 25, 2019 at 2:07:11 PM UTC-4, Bassam Abdul-Baki wrote:
> Greetings,
>
> In the following code, there's a bug on certain parameters.
>
> --
>
> def per(n, steps = 0):
> digits = [int(i) for i in str(n)]
> result = 1
> for j in digits:
> result *= j
> steps += 1
> p
On Monday, March 25, 2019, at 3:31:09 PM UTC-4, CrazyVideoGamez wrote:
> I have no idea what "TypeError: unsupported operand type(s) for +: 'function'
> and 'int'" means and I don't know how to fix it. Help!
--
https://mail.python.org/mailman/listinfo/python-list
I have no idea what "TypeError: unsupported operand type(s) for +: 'function'
and 'int'" means and I don't know how to fix it. Help!
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, March 20, 2019, at 7:34:53 PM UTC-4, CrazyVideoGamez wrote:
> So, I typed in code:
> from turtle import *
> forward(100)
> right(120)
> clear()
> It didn't work! It kept on saying that there was an indent and the first line
> was wrong. Help!
I'm a
16 matches
Mail list logo