0
System.out.println("ok") meaning?
The code class System: def __init__(selfself,x): self.x=x class out: def println(other): print(other) try: System.out.println("ok") except: print("no") I am not sure what is the meaning of System.out.println("ok) in the first part the constructor __init__ is defining the x Can you explain the code below what function is doing?
3 Antworten
+ 3
System.out.println() is from java.
println() prints stuff.
System.out.println("hello");
//output: hello
By creating a class System you get the effect that you can use java syntax inside python.
+ 1
It prints ok:
https://code.sololearn.com/cvwufrBu3Xa3/?ref=app
0
why in our case the output is - no , instead of ok?