Posts by Bilbo • 187 points
9 posts
-
3
votes3
answers230
viewsQ: Remove lowercase letters from a list
I was trying to make a program that could identify whether a letter is in upper case or in Lower case in a list, so that it would delete the lower case letters. frase = ("A B C D e f g h") new =…
-
2
votes2
answers2053
viewsQ: Eoferror: EOF when Ading a line
I’m doing a program that’s a resolution of this issue of the Computer Olympiad. A, B, C = input("A").split(), input("B").split(), input("C").split() A, B, C = int(A[0]), int(B[0]), int(C[0]) if A…
-
5
votes2
answers441
viewsQ: Check if a string belongs to a list
This program is only printing that the letter entered by the user is a consonant, even when it is a vowel. I think it has to do with the in and not in, but I’m not sure. mensagem= list (input…
-
-4
votes1
answer100
viewsQ: Except is not capturing the exception
mensagem_de_modalidade = int (input (''' Como você quer jogar ? 1)Solo 2)Em dupla 3)Em trio''')) try : if mensagem_de_modalidade == 1 : print ("oi") if…
-
1
votes1
answer52
viewsQ: "except" does not recognize value as wrong
mensagem = input('''Clique "C" ''') print (mensagem) #condições relativas ao input mensagem try : mensagem == "C" except Exception : print ("a casa caiu") else : print ("a casa não caiu") The…
-
1
votes1
answer75
viewsQ: Variable loses value inside "for"
a=2 for a in range (9) : print (a+1) Why using the for, in this case, it is printed from 1 to 9, and the variable a is equal to 2?
-
0
votes1
answer973
viewsQ: Could you create a function to decrease the number of if’s in the program?
There is a way to make a function that can reproduce that amount of if’s in the program so that they do not appear ? mensagem = (''' Escolha a conversão que você deseja : 1) Celcius-Fareheint 2)…
-
0
votes1
answer82
viewsQ: I want to put 2 exceptions for my program validate data
a = (''' Escolha a conversão que você deseja realizar: 1) Celcius-Fahrenheit 2) Fareheint-Celcius 3) Celcius-Kelvin 4) Kelvin-Celcius 5) Fahrenheit-Kelvin 6) Kelvin-Fahrenheit ''') try : a =…
-
1
votes1
answer123
viewsQ: The program is not recognizing whole number as such
a = int (input ("insira um número :")) if a != int : print ("isto não é um numero inteiro") else : print ("seu número foi :"+ str(a)) I’m trying to make a program where the user puts a value and the…