0

whats wrong with this ?

print "Hello world " print"enter any word u want to output" x=input() print(x) i cant find whats wrong!!!!

6th Sep 2016, 3:30 PM
Tamim Mostafa
Tamim Mostafa - avatar
11 odpowiedzi
+ 2
print requires () try: print("Hello world") the same with input("question") try: x = input("enter any word u want to output")
6th Sep 2016, 3:46 PM
Hymn
Hymn - avatar
+ 2
I've tried it also on Qpython3 and it works
6th Sep 2016, 4:09 PM
Hymn
Hymn - avatar
+ 2
tnxx david lorenzi .. i was actually trying it on Qpython thats way it was not working...!! tnx a lot..
6th Sep 2016, 4:29 PM
Tamim Mostafa
Tamim Mostafa - avatar
+ 1
I tried the code in the playground. I had to add brackets for the print function in the first two lines. But then the code was working. print("Hello world ") print("enter any word u want to output") x=input() print(x) Did you also try it here in the app or somewhere else?
6th Sep 2016, 3:46 PM
Amarie
+ 1
in the code playground sometimes it gives me No Output, and sometimes only the first 2 instructions. But the code is correct, let's try it on pc
6th Sep 2016, 4:00 PM
Hymn
Hymn - avatar
0
and it is showing a name error...
6th Sep 2016, 3:33 PM
Tamim Mostafa
Tamim Mostafa - avatar
0
i tried this ... but it still wont work print("Hello world ") x=input(" enter any word :") print(x)
6th Sep 2016, 3:55 PM
Tamim Mostafa
Tamim Mostafa - avatar
0
i tried this too print("Hello world ") x = input(" enter any word :") print(x) it shows <built-in function any>
6th Sep 2016, 3:58 PM
Tamim Mostafa
Tamim Mostafa - avatar
0
i tried it on android based app called "QPython" and "decoder" :( .... thanks though...
6th Sep 2016, 4:04 PM
Tamim Mostafa
Tamim Mostafa - avatar
0
If you are using python 2, the code will be like this: print "string" x = raw_input("prompt >>> ") If you are using python 3: print("string") x = input("prompt >>> ")
6th Sep 2016, 9:43 PM
Alansary