+ 1
Asking for some codes
Hi Can you please tell me how can I have these results? Code 1: Input : example Output : e x a m p l e Code 2: Input : example Output : elpmaxe If there are modules or functions about these codes ; please send me ; thanks a lot
12 Answers
+ 13
Please do not ask for a code. Do a try by yourself first, put your code in playground and link it here. If you get stuck, you can ask for help. Thanks!
+ 4
Code Crasher thanks my friend ; I got my answer
+ 4
Mirielle One-liner code - Ok, lambda is redundant🤔
print(" ".join(n), n[::-1], sep="/n")
+ 3
s=input()
e1=list(s) # for Code 1
e2 =s # for Code 2
print(*e1)
print(e2[::-1])
https://code.sololearn.com/c80GGl1Clhs0/?ref=app
+ 3
List and strings shares almost every methods so you don't need to convert strings to list before You can index, join or splice them.
```
print("\n".join((lambda n:[" ".join(n), n[::-1]])(input() or "example")))
```
+ 3
Lobzov Alexey Code Crasher Mirielle
Actually I'd rather like to 10 small lines instead of 1 unreadable line and I'm in WET (We Enjoy Typing) team
+ 3
Mr.Lightning it's all about writing an efficient code, lambdas are top in efficiency.
ref: python.org
+ 2
Lobzov Alexey zen of Python isn't against the use of lambdas or oneliners. It only talk about making a code readable (not all oneliner are unreadable)
+ 1
To Mirielle
Сan u read Zen of Python😉💪
In code:
import this
0
I don't know what function shoudl I use ; if you know please tell me and I'll use it
0
LEGEND GAMER 916 We're talking about Python
Mirielle Code Crasher I haven't read about Lambdas yet ; however thanks for answers
- 3
<!DOCTYPE html>
<html>
<head>
</head>
<body><h6 style="color:blue;"style=" font-size:600%;">RANDOM FACTS</h6>
<img src="" alt="dragonfly" width=400 height=300>
<p style="font-size:100%;">A dragonfly is an insect belonging to the order Odonata, infraorder Anisoptera.</p>
<img src="" alt="SUN" width=400 height=300>
<p style="font-size:100%;">The Sun is the star at the center of the Solar System.</p>
<img src="" alt="first bulb(incansadent bulb)" width=400 height=300>
<p style="font-size:100%;">An incandescent light bulb, incandescent lamp or incandescent light globe is an electric light with a wire filament heated until it glows.</p>
<img src="" alt="first book" width=400 height=300>
<p style="font-size:100%;">The first book ever written that we know of is The Epic of Gilgamesh: a mythical retelling of an important political figure from history.</p>
<img src="" alt="volcano" width=400 height=300>
<p style="font-size:100%;">A volcano is a rupture in the crust of a planetary-mass object, such as Earth, that