Posts by Gustavo Matias • 77 points
4 posts
-
0
votes2
answers932
viewsQ: How to store values of a list in individual variables without knowing its size?
I need to assign each integer value within a list of at least 1 item and at most 10 items to a separate variable. Then decrease 1 of each item, add them and print the result. These numerical values…
-
6
votes1
answer295
viewsQ: Why does Fractions.Fraction(1/3) not return "1/3"?
import fractions a = int(input()) b = 1 / a b = fractions.Fraction(b) print(b) This is a piece of code I’m developing. This part had the function of taking the decimal resulting from the division "1…
-
0
votes2
answers1580
viewsQ: How to assign values to an undefined amount of python variables?
To assign values to multiple variables just follow this structure: a, b, c = 1, 2, 3; This I know, but what if for example I want to store several values that came from an input without knowing the…
-
0
votes3
answers2911
viewsQ: How to assign 3 values to 3 variables in only one python input line?
# Esse é um programa que você irá digitar 3 pontuações e ele irá te informar o vice campeão (ou segundo lugar) # Existe algum método de atribuir o valor de a, b e c em apenas uma linha na entrada? #…
pythonasked Gustavo Matias 77