Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Python 3 Simple code doesn't work

+2 votes
asked May 4, 2021 by Patryk Markowski (140 points)
liczba = int ( input ( "Podaj liczbÄ™":))
while liczba > 0:
    kolejna cyfra = liczba % 10
    print ( kolejna cyfra)
    liczba = int (liczba/10)

4 Answers

+3 votes
answered May 15, 2021 by xDELLx (9,400 points)
liczba = int ( input ( "Podaj liczbÄ™:"))
while liczba > 0:
    kolejna_cyfra = liczba % 10
    print ( kolejna_cyfra)
    liczba = int (liczba/10)

pay attention to the errors pythons shows!!!
0 votes
answered May 16, 2021 by niharika jatia (140 points)

liczba = int ( input ( "Podaj liczbÄ™"))
while liczba > 0:
    kolejna_cyfra = liczba % 10
    print ( kolejna_cyfra)
    liczba = int (liczba/10)

copy the above code you need to remove the colon and add underscore to kolejna cyfra

0 votes
answered May 17, 2021 by Vigneshwaran M (140 points)

in the first line, you have added the : outside the quotation marks

change the first line to liczba = int ( input ( "Podaj liczbÄ™:"))

now it will work perfectly

0 votes
answered May 18, 2021 by MOTATI SWAPNA (160 points) 1 flag

First line of your code should replace with liczba = int ( input ( "Podaj liczbÄ™:"))

the variable name should not contain space .so replace the "kolejna cyfra" with another name which does not contain spaces and special symbols except underscore _.like "kolejnaCyfra" or "kolejna_cyfra"

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...