Questions tagged as 'python'

2
answers

Python chart does not display values correctly

I'm trying to learn how to make graphics in Python. I did one now and it was not very good: AlldatesareonApril10,2017,onlycomingfrom07:50a.m.to08:40p.m.(GMT-3h)Inthefigure,itappeareduntilthedatetodayand,asaresult,thepointsdisappeared.Ontheti...
asked by 29.05.2017 / 01:29
2
answers

Which equivalent operator is different in Python?

I know some other operators: Greater than: > Less than: < Equality: == But what about the "different" operator, as it is in Python?     
asked by 25.06.2018 / 22:37
2
answers

Why does not my while work?

I'm studying repetition structure and in one of the exercises I had to check the sex typed, so I made the following code: sexo = input("digite m ou f: ") while sexo != 'f' or sexo != 'm': sexo = input("digite m ou f: ") However, it does...
asked by 22.08.2017 / 14:15
1
answer

Doubt how to mount socket in old game in Python [closed]

I have a job in the network programming course and were asked to use a game code and make a client and server using sockets , but my teacher's explanation was very vague and he does not support students at all. I've already put everythi...
asked by 28.06.2017 / 15:35
1
answer

What is the First-Class of Python?

The first-class Java language are objects, because you can not create anything in Java without the use of classes. In Haskell, following the same criteria as before, the first-class functions. In the case of Python, what is considered the first-...
asked by 19.10.2017 / 19:39
2
answers

Make server socket not tkinter allow client input

The program works correctly, it creates a server for your user, the server opens without problems. But when I use a client to access it, the following message appears on the server client:    Traceback (most recent call last):     File "C: \...
asked by 04.01.2017 / 17:30
3
answers

Avoiding code duplication without the use of switch / case in the Python language

Friends, I have the following code in Python: data_hoje = time.strftime("%d %b %Y", time.gmtime() ) #data de hoje data_desejada = time.strftime("%d %b %Y", time.gmtime(time.time() + (3600 * 24 * 2))) # daqui a 2 dias I know that in Pyth...
asked by 01.03.2017 / 04:26
3
answers

Listening with conditional list

My goal is to count how many elements of a given list correspond to a condition. For that, I made the following lines of code: cont = 0 seq = [] max = 10 for x in seq if x == max: cont = cont+1 However, I get syntax error in if x ==...
asked by 18.03.2017 / 14:06
3
answers

"break" does not end execution as it should

   Create a program where the user can type multiple numeric values and sign them into a list. If the number already exists inside, it will not be added. At the end, all the unique values entered will appear in ascending order. And so far so...
asked by 20.12.2018 / 18:42
2
answers

How to read variable from another program?

I'm learning programming and I would like to know: how do I make the program read the value of a variable from another program (theoretically this would be without "awareness" of the program read, I do not know exactly how this works, some permi...
asked by 09.08.2014 / 04:01