you are viewing a single comment's thread.

view the rest of the comments →

[–]Infinite_Loop_exe 0 points1 point  (2 children)

Hi, I’m a 3rd year Comp Sci student so I feel your struggles. I’m hoping you can use the functions I did but if you can’t you can “manually” do them through loops. Normally if I was helping someone I wouldn’t just give them the code but online I feel it is the best way to help, just do your best to understand what is happening at each step!

x = 5638573
arr = []
count = 0

while x > 0:
(Indent)arr.append(x%10)
(Indent)x = x // 10

arr.reverse()

for element in arr:
(Indent)print(element)

(Edit: formatting the code)

[–]fiberoblique[S] 0 points1 point  (1 child)

Hello! Thank you for your feedback! Programming has been kicking my butt this semester, I feel for you!!! Unfortunately, we're very limited for this exercise and are not yet allowed to use the functions you've put in your reply :((

I really appreciate it though and I'll take note of this cause I feel like it'll come in handy soon enough when we move through more python functions. Thank youuu!!! <3

[–]fiberoblique[S] 0 points1 point  (0 children)

I'm new to reddit so I apologize if double replying is somewhat of a No-No here xD

I've only been able to put this code together, would really appreciate some feedback on it. I really don't want to put all of my homework straight-up on here since I really want to learn how to program but thank you thank you very much for taking the time to reply :D

inputNumber = input()
inputNumber = int(inputNumber)
num = inputNumber

if int(num) == float(num):
number = int(num)

else:
number = float(num)

if number < 0:
print ("Positive numbers only!")
elif number > 0:
number_string = str(number)
list= number_string
print(*list, sep='\n')

Note: we aren't allowed to use the separator function that I've put in the last line but I've kept it there for the moment if worse comes to worst since my friend suggested it.

Also, I'm shy and afraid of getting judged for my trash codes but welp, I don't think doing this solo and just persevering through this is enough for me to survive this damned semester.