u/Healthy-Departure961

Why? return statement didn't gave me of all output of arg ..

In this code, I want to get the output of all the numbers in the for loop. I can do this using print(arg), but when I use a return statement, I only get the output of a single number. How can I modify the code so that return gives me all the numbers from the for loop?

print(func1(80, 30, 40)) def func1(*args):
  for arg in args:    
    # print(arg, end=" ") 
    return arg

# output using print = 80 30 40 None
# output using return = 80        

print(func1(80, 30, 40))
reddit.com
u/Healthy-Departure961 — 2 days ago

just breaking things with python

numbers = input("Enter the numbers")

in_dex = numbers[-2]

divisible = int(in_dex/3)

print(divisible)

when print the output of the divisible i am getting (nsupported operand type(s) for /: 'str' and 'int') i do know how to write correctly to get the output but i thinks that why not this way..so when i did got error don't know why cause both values are int

reddit.com
u/Healthy-Departure961 — 6 days ago