Write the output of the following python code. a = "Hello, World!" print(a.lower())
Answers
hello, world!
The output of the following códe will be hello, world!
Explanation
In this códe
a = "Hello, World!"
print(a.lower())
a is a variable and a string i.e. Hello World! is assigned to it.
lower() method is used to change all the letters in the string to lowercase letters.
Uppercase Letters => A, B, C, D, E, and so on.
Lowercase Letters => a, b, c, d, e, and so on.
In the string letters, H and W are uppercase letters, and the lower() method was used that is why they got changed to lowercase letters. And string contains some lowercase letters on which the lower() method has no effect since they are already lowercase letters.
Extra Information
Examples of print() statement
print("Hello World")
Output
Hello World
print(5/2)
Output
2.5
x = ("apple", "banana", "cherry")
print(x)
Output
('apple', 'banana', 'cherry')
Python is created by Guido van Rossum and came into existence in 1991. It is a high-level and general programming language. It is a very lucid programming language as it has a good language construct and object-oriented approach. It is dynamically typed and garbage-collected.