Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
If else if in 2 ways
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#python 3.5.2 acceptedyes_list = ["yes", "yeah", "Yes" , "Yeah"] acceptedno_list = ["No", "no"] QuoteReplay_str = "yes" if QuoteReplay_str in acceptedyes_list: print("You accepted") elif QuoteReplay_str in acceptedno_list: print("You did not accept") else: print("You entered wrong choice") message = (lambda s:"You accepted" if s in acceptedyes_list else "You did not accept" if s in acceptedno_list else "You entered wrong choice")(QuoteReplay_str) print (message)
[
+
]
Show input
Absolute running time: 0.27 sec, cpu time: 0.25 sec, memory peak: 6 Mb, absolute service time: 0,28 sec
edit mode
|
history
|
discussion
You accepted You accepted