Questions tagged as 'python'

2
answers

Syntax error in .py file [closed]

I searched for a .py code on the internet and at the time of running it, the following message exits: File "C: \ Users \ Valnei \ Desktop \ XatExploit.py", line 26 print "Trying password = >" + str (String_7) SyntaxError: invalid syntax...
asked by 10.02.2017 / 19:02
3
answers

When should I use "return" or "print" in a function?

Can you exemplify any situation that may be exercised by one command but not another? Because the same thing happened here in both commands. Using print : >>> def media(x1, x2): ... print((x1+x2)/2) >>> x = media...
asked by 24.10.2018 / 19:45
1
answer

Does not satisfy the condition with the value informed by the user

I made this code, but it does not enter the option entered by the user (I think the options already says what he has to do). lista = [] while True: print("Adicionar nome - 1") print("Sair - 0") print("Listar - 2") op = input()...
asked by 28.06.2018 / 14:35
3
answers

Lists count total quantity and highest repetition [closed]

Hello, I would like to know how I can count the number of items in a vector, and also show the number that appears the most. Example: Given the vector [1,2,3,4,5,6,7,8,8,8] There are 10 elements 8 (number with most repetition)     
asked by 13.09.2018 / 19:54
2
answers

Transform string into algorithm

Can anyone tell me if there is a way for me to transform a string into an algorithm? for example: a="1 + 1" = > b = 1 + 1. For simple examples it is quiet to create a string interpreter, the problem is that I will get into more complex things...
asked by 26.05.2018 / 23:33
1
answer

SublimeRepl does not rotate the code

I'm using Sublime to write some code in Python and the Sublime REPL to "rotate" the codes. Anyway, I installed by package control, so far nothing strange, but when I put to run by REPL he gives "file not found error". How do I get it to roll?  ...
asked by 02.10.2014 / 22:00
3
answers

Problem using if elif else (error in else)

n = input ("informe seu nome ") b1 = float(input("informe sua nota em Biologia no 1º Bimestre ")) b2 = float(input("informe sua nota em Biologia no 2º Bimestre ")) b3 = float(input("informe sua nota em Biologia no 3º Bimestre ")) b4 = float(input...
asked by 25.10.2015 / 06:00
4
answers

Python, How to let the person put a number and with that number put that same amount of questions [closed]

Is it possible to do such a system in Python, let's suppose on a college system if I put materias = print(input("Digite o número exato de matérias que há nesta série: ")) What it takes to repeat the same amount as the person put type like...
asked by 26.01.2017 / 02:46
2
answers

Display array in python

I have an array of n by n and use this part of code to display it: for i in range(len(data)): for j in range(len(data[0])): print ((data[i][j])) Being data the matrix. But the output looks like this: 5 4 1 10 2 3...
asked by 22.11.2018 / 19:53
1
answer

Rename files with date in python

I would like to rename files from one folder and send them to another folder, but I wanted it to contain the date or that it at least put a number after the name if it already had an equal. The code is this below, but as there are several files...
asked by 23.10.2018 / 19:32