0
No output in python?
By creating an if , elif conditions If the if condition is false The elif condition is not checking and its giving only 'No output ' in console . https://code.sololearn.com/ca2f7vFR6TCh/?ref=app If This youtube url is input https://youtu.be/k8SXsT5TLxQ Its displays no output...
5 Respuestas
+ 2
Jaya Balan A R
When making a function you need () at the end.
def functioname():
You can pass 'a' inside these parentheses and remove from the first line.
You must call a function otherwise it would never run.
How to call a function? Simply write,
print(functionname())
if 'a' is the parameter inside so u can pass the input like,
print(functionname("habzhshanzbhsjanahshsjah")
You should have RETURNS instead of PRINTS inside ur function, otherwise they can return an output 'None' which u dont want.
+ 2
Can you please send the code so that I can help you?
+ 2
to check if a string B is a substring of a string A, use 'if B in A' . so the code will be:
a=input()
b='watch'
c='youtu.be'
def utubeid(sring)
if b in string:
return a[32:]
elif c in string:
return a[17:]
print(utubeid (a))
+ 1
the problem is that if none of those conditions is satisfied, the return value will be None. you must take this in account.
+ 1
Thanks for the answers and suggestions
I solved it ...😊😊