Challenge.
• Create a function named 'a' that takes a string as parameter and returns a new string after converting it to lowercase.
Character limit - less than 12 characters.
Language - Python.
Share
Challenge.
• Create a function named 'a' that takes a string as parameter and returns a new string after converting it to lowercase.
Character limit - less than 12 characters.
Language - Python.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Language:
Python
Program:
def a(string):
if len(string)<12:
new=""
for i in string:
new+=i.lower()
return new
else:
return None
Examples of input output:
print(a("HELLO")) #outputs hello
print(a("CS")) #outputs cs
Explanation:
Attachments:
Answer:
String s;
System.out.println ("Enter string");
s=sc.next();
int l=s.length();
for (int a=0;a<=l-1;a++)
{
char ch=s.charAt(0);
(String)d=d+ch;
}
d=d.toLowerCase();
System.out.println (d);
This one I have written in Java.
This will prove as a pathway to write in PYTHON.
Only the format needs to be changed but the processes are all same.