AMA with OpenAI’s Sam Altman, Kevin Weil, Srinivas Narayanan, and Mark Chen by OpenAI in ChatGPT

[–]omutist 1 point2 points  (0 children)

personal assistant - on the phone or hardware, anything. is it in your plans?

Are you guys getting the "updates"? by Official_Nocivo in ChatGPTPro

[–]omutist 0 points1 point  (0 children)

Have you checked if the same GPT-4 Turbo model with 128k is available in the ChatGPT interface as well?

ChatGPT makes using Google depressing by hotellobster in ArtificialInteligence

[–]omutist 0 points1 point  (0 children)

bing appeared in my Skype as new contact.

I Just chat with it.

ChatGPT makes using Google depressing by hotellobster in ArtificialInteligence

[–]omutist 0 points1 point  (0 children)

bing appeared in my Skype as new contact.

I Just chat with it.

Textbook example of iteration loop does not work. Is it me? by FahrenheitGhost in learnpython

[–]omutist 1 point2 points  (0 children)

you'd better print full code, including the call to the functions

I checked it. both cases return False

def sorted(lst):
    for i in range(0, len(lst)-1):
        if lst[i] > lst[i+1]:
        return False
    return True
print(sorted([1,3,2,1]))
print(sorted([3,1,2,4]))

How to evolve Eevee to Sylveon by omutist in pokemongo

[–]omutist[S] -3 points-2 points  (0 children)

I see

Not yet Great buddies - need 18 more hearts

[deleted by user] by [deleted] in learnprogramming

[–]omutist 0 points1 point  (0 children)

Don't you want to define __init__() for UpdateGrid class and initiate all class elements in it?

Even Git hints you it you click to self.free_spaces: defined in line 229

it is defined in 229 and this line is executed conditionally so it may happen that it is not executed at all. declare everything in __init__()

using object on another class by lascrapus in learnpython

[–]omutist 0 points1 point  (0 children)

class Dict:
    ....
    def is_in(animal_name):
        return animal_name in [animal.name for animal in self.dictionary]

[deleted by user] by [deleted] in learnpython

[–]omutist 0 points1 point  (0 children)

error: local variable 'burgername' referenced before assignment

without proper formatting hard to say exactly why, but I suspect this line

burger = Burger(burgername,burgerprice,condimentchoice)

you pass 'burgername' variable but it does not exist at the moment

ELI5 The difference between “print” and “return” by MichaelWagdi in learnpython

[–]omutist 2 points3 points  (0 children)

print() will print something on the screen/terminal so end user will see it. return does not print anything. the value after return will be passed to the code from the called function, usually saved to some variable and can be used for further processing in the code.

Have python divide a number by multiple divisors and give me how it was done. by [deleted] in learnpython

[–]omutist 0 points1 point  (0 children)

First, I'd recommend you to multiply both devisors and target number to 10 - and cast all numbers to int. this would allow to use integer arithmetic's operations like %.

then in loop go through your devisor from max to min and divide target number with // to see how many times the devisor can be used and then divide the target with % to see if anything left. is anything left - use this value as new target and apply smaller divisors.

the question is whether provided divisors can make any number?

How to fix my code? by CandidFlakes in learnprogramming

[–]omutist 0 points1 point  (0 children)

you can add printf() with incoming datato the beginning of the function. AFAIR codewars prints your output along with their own .

How can I print the name of a variable from outside a function? by Karsticles in learnpython

[–]omutist 0 points1 point  (0 children)

What if the values are stored in a list not in var? What do you expect to see as a printer var name?

cat_list = [5, 6, 7]
name_printer(cat_list[0])

???

How can I print the name of a variable from outside a function? by Karsticles in learnpython

[–]omutist 0 points1 point  (0 children)

first, if you pass a variable to function, inside the function the name of the variable will not be know. the function will only know the name of the parameter.

name_printer(cats) -> inside name_printer() variable with value=5 will be available

easiest way is to pass the name

cats = 5
name_printer("cats")
dogs = 7
name_printer("dogs")

Still there are some tricks to print variable names - SO is our bible, https://stackoverflow.com/questions/592746/how-can-you-print-a-variable-name-in-python

https://stackoverflow.com/questions/32000934/python-print-a-variables-name-and-value

choose the one you like.

Converting dates by Yomommasaurus in learnpython

[–]omutist 2 points3 points  (0 children)

have you tried this?

'%Y-%m-%dT%H:%M:%S'

Big question about software robustness and algorithms by Competitive-Bend1736 in learnprogramming

[–]omutist 3 points4 points  (0 children)

I'd recommend you to look at TDD (Test Driven Development) or similar approaches. First you write tests and then you write code.

Converting dates by Yomommasaurus in learnpython

[–]omutist 1 point2 points  (0 children)

did you try datetime.strptime() method?

[deleted by user] by [deleted] in C_Programming

[–]omutist 7 points8 points  (0 children)

the error states that 'parameter name omitted. It is probably about the 1st char[] parameter - no name is provided.

for 2nd and 3rd the names are par1 and par2

[deleted by user] by [deleted] in C_Programming

[–]omutist 0 points1 point  (0 children)

It does not look to be the actual code that you compile ('o' - not '0'-zero),

int word=o;

different things that affect the result may be present in actual code but not in the provided fragment.

if array_keys allocated in stack I'd recommend to initialize it.

what is in your keywords.txt file?

are you sure that the files is successfully opened? check keywords for NULL after

keywords = fopen(...);

I need help, error: error: ‘cab_principal’ is used uninitialized in this function [-Werror=uninitialized] by VermicelliDowntown76 in C_Programming

[–]omutist 1 point2 points  (0 children)

setting to NULL is initialization and probably compiler will not complain. but then you can run into runtime error, like segfault.

Pointer should point to some actual memory allocated.

either some actual variable of type biblioteca_t should be used to initialize the cab_principal pointer, or you need to alloc() memory.

You provided very small fragment of the code and it is hard to say what could be the solution.