Ich habe eine Datei namens helloworld.simon
gemacht. In There ich geschrieben habe:Python Wenn Variable in Variable
Public class helloworld {
main = (main.method());
main {
console.print("Hello World");
}
Und ich habe diesen Code Geschrieben:
Public = ("Public")
Private = ("Private")
code = open('helloworld.simon' , 'r')
print(code.read())
if Public in code:
print("Pub")
else:
print("J")
And The Output ist:
Public class helloworld {
main = (main.method());
main {
console.print("Hello World");
}
J
Was ist Ihre Frage? –
Es gedruckt "J" das ist das Problem albern! Lol – andre3wap
Hinweis: 'in' sollte für String-Objekte, nicht Dateiobjekte verwendet werden – Kevin