+ 17

[challange] write a python program with output "Hello world" with a little handicap...

.... the character "p" is forbidden in the whole coding exception is the keyword import, no print, no map,.... have fun

21st Jan 2018, 11:21 AM
Oma Falk
Oma Falk - avatar
29 Respostas
+ 6
I solved it without "p"s or "P"s + I solved it without "e"s or "E"s Solution in the link https://code.sololearn.com/cHbYf8aZHlt3/?ref=app
20th Jul 2018, 2:07 PM
Seb TheS
Seb TheS - avatar
21st Jan 2018, 11:34 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
20th Feb 2018, 1:17 PM
warlord
warlord - avatar
+ 13
Python without 'p' 😂 Here is mine: exec('chr(ord("o")+1)rint("Hello World")');
21st Jan 2018, 1:07 PM
777
777 - avatar
+ 13
Anna You were right, that was possible, with __builtins__ involved. After getting some help from stackoverflow, here it is: The best i reached is: without a, e, f, g, h, j, k, m, o, p, q, v, w, x, y, z I think it is also possible to add 'c' to the list, but no time now ... https://code.sololearn.com/cNLgKTn3GnFF/?ref=app
20th Jul 2018, 1:11 AM
Cépagrave
Cépagrave - avatar
+ 11
I used only one p in import (It is allowed?): https://code.sololearn.com/cl7zF3cVf79j/?ref=app
21st Jan 2018, 1:24 PM
Paul
Paul - avatar
+ 11
Found this even if not 100% correct https://code.sololearn.com/cOUVpTwnGRWH/?ref=app
21st Jan 2018, 3:27 PM
Oma Falk
Oma Falk - avatar
+ 11
I propose a next step in this challenge : Hard level = same assignment, not only 'p' forbidden, but also 'e' !! (Not sure it's possible with python)
19th Jul 2018, 3:27 PM
Cépagrave
Cépagrave - avatar
+ 10
Lipogram code ! Nice idea. https://code.sololearn.com/c9jXhZTrpBZr/#py What about 'sulqw Khoor Zruog' ? https://code.sololearn.com/ce6Yzve03WBX/#py
16th Jul 2018, 10:37 PM
Cépagrave
Cépagrave - avatar
+ 10
Anna Hey Anna ! I was looking in this direction too, unfortunately 'print' is not included in dir('__builtins__'). 'import builtins' is needed, and writing it uses a 'p' So I found a solution that will work on the web version of SL only, and ... I'm not so proud of it. https://code.sololearn.com/cqoaowCNM6W6/?ref=app
19th Jul 2018, 8:30 PM
Cépagrave
Cépagrave - avatar
+ 9
I also used one p in import, is this allowed? https://code.sololearn.com/c7gB6AHzRsW8/?ref=app
21st Jan 2018, 2:34 PM
Ferhat Sevim
Ferhat Sevim - avatar
+ 7
Wow ... Sorry guys, I cant mark one answer as best! It is not the one answer which I really like but so many different solutions like -hiding p with an expression for p in all tastes - warning - python egg - use stdout instead of print Thanks to all posts for it!
22nd Jan 2018, 10:14 AM
Oma Falk
Oma Falk - avatar
+ 6
@Ferhat yes.. a further version
21st Jan 2018, 2:39 PM
Oma Falk
Oma Falk - avatar
+ 5
@Paul,, yes it is allowed. Very nice solution!
21st Jan 2018, 1:37 PM
Oma Falk
Oma Falk - avatar
+ 5
Cépagrave I'm already playing it with as least alphabets as possible 🤣 ...wait, without 'e' !? no exec, no eval, no write is that possible!? 🤔 ------------------------------------------------------ here's the code without 'p' and with 1 'e' https://code.sololearn.com/c7zv2SqQlASQ
19th Jul 2018, 3:34 PM
Flandre Scarlet
Flandre Scarlet - avatar
+ 5
Cépagrave I think it might be possible in python. Maybe if you call the print function via __builtins__.print.__call__(), but instead of calling the function directly, you use something like dir(dir(__builtins__)[])[] with the indices of the print and call functions in the square brackets... It's difficult though and probably won't run on every device
19th Jul 2018, 6:49 PM
Anna
Anna - avatar
+ 5
Cépagrave Congratulations, very well done 👍 Every method I found just returned the function name as a string ("print") and I would have needed eval or exec to actually run it (Btw, how can I reply to a comment or address a user directly?)
20th Jul 2018, 6:05 AM
Anna
Anna - avatar
+ 5
Darya Zykin nice! a new solution
20th Jul 2018, 6:17 PM
Oma Falk
Oma Falk - avatar
+ 5
This program outputs 'Hello World!' on the screen without any print statemant. It's not actually without any 'p', but at least the print() function is not used https://code.sololearn.com/cW4X91aHyYrQ/?ref=app
27th Aug 2018, 7:07 PM
Vranceanu Robert 🇷🇴
Vranceanu Robert 🇷🇴 - avatar
+ 3
well... eval is good to use :D https://code.sololearn.com/c4EBOP6Xx89Z
17th Jul 2018, 12:07 AM
Flandre Scarlet
Flandre Scarlet - avatar