0
syntax error what did i wrong
Hello there, I was trying this (python) code here: input: 1 name = input("enter your name: ") 2 print('Hallo '(name)', and welcome in "the Invisble House".') output: File "..\Playground\", line 2 print('Hallo '(name)', and welcome in "the Invisble House".') ^ SyntaxError: invalid syntax but It did'nt work and I don't know what I did wrong. so my question is what did I wrong and Why did'nt it work?
9 ответов
+ 2
it should be
name = input("Enter your name: ")
print ("Hallo " + name + ", welcome to 'the Invisible House.'")
+ 1
sorry, I forgot to say it was written in python.
and yes hallo should be hello.
+ 1
OK in that case I don't believe you do need a semicolon at the end of your statements. However, could someone more knowledgeable about python confirm that.
+ 1
@god usopp, I am not saying that it is. I am asking whether python statement SHOULD end in a ; to mark the end of the statement like in Java. I have reached the conclusion that they don't.
0
also I don't know if it's intentional but Hallo should probably be Hello
0
What language is this in? Should there be a ";" at the end of statements ?
0
@josh mizzi
it's not a semicolon it's a period (.) and then single quote closing (').
0
@josh mizzi
As I've said before, it's not a semicolon it's a period (.) and a single quote closing ('). It just looks like a semicolon because they are right after each other
'. or .'
vs
;
0
@josh mizzi
correct, they don't