+ 1

Is this code right ?

Anyone here, Please help me I am new to Python. So please let me know what is wrong in it.. * * print ( 'Welcome to Piglatin Translator!') py = "ay" original = raw_input("Enter any valid English word: ") if len(original) > 0 and original.isalpha() == True: first = original[0] new = original + first + py new = new[1:original(new)] print (new) else: print ("Enter Something")

13th Sep 2017, 12:20 PM
Junaid Choudhary
Junaid Choudhary - avatar
6 Antworten
+ 3
Is raw_input() still valid? I am not sure as I thought it isin 2.7!
13th Sep 2017, 12:35 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
Run the ccode on code playground
13th Sep 2017, 12:35 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
Nope it is invalid raw_input no longer exists. First, convert input to list. let it be lis do: lis=(lis+[lis[0]])[1:] print("".join(lis)+"ay")
13th Sep 2017, 12:38 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
It's okay. Just ask me for Python basics!
13th Sep 2017, 1:31 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
okay i gotcha thanku..😄
13th Sep 2017, 1:30 PM
Junaid Choudhary
Junaid Choudhary - avatar
0
Sure😄
13th Sep 2017, 1:52 PM
Junaid Choudhary
Junaid Choudhary - avatar