+ 1

How can i write this C program in python with exactly matching lines? please help me.

#include<stdio.h> #include<string.h> int main() { int len,i; char alc[100]; scanf("%s",&alc); len=strlen(alc); for(i=len-1;i>=0;i--) { printf("%c",alc[i]); } return 0; }

8th Jun 2020, 6:26 PM
Varun N
Varun N - avatar
8 ответов
+ 4
The new method is good thnx
8th Jun 2020, 7:37 PM
Varun N
Varun N - avatar
+ 2
Abhay thnx for help but it is producing a syntax error
8th Jun 2020, 7:01 PM
Varun N
Varun N - avatar
+ 1
I think it's accepting a string and printing letters in reverse order In python that would be a=input() String_length=len(a) for i in range((String_length-1),-1,-1): print(a[i],end="")
8th Jun 2020, 6:52 PM
Abhay
Abhay - avatar
+ 1
Working fine Input: hello Output: olleh
8th Jun 2020, 7:04 PM
Abhay
Abhay - avatar
+ 1
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 yup I know but he said the exactly or somewhat like c program
8th Jun 2020, 7:31 PM
Abhay
Abhay - avatar
0
Thnx i had missed something now its fine :)
8th Jun 2020, 7:06 PM
Varun N
Varun N - avatar