+ 5
Task The upcoming code takes text data as input. Write the code to convert it to uppercase and display it on the screen.
Input Example Expected Output text = 'hello' HELLO text = 'nasa' NASA text = 'bmw' BMW
20 Antworten
+ 8
Use .upper() function..
Please show us your attempt, even though it's not completed..
+ 4
Well, that is a fair start for a first draft. There are no errors, but the variables are not used after their assignments. It just prints from literal values, the same as simply this:
print("hello".upper())
print("nasa".upper())
print("bmw".upper())
See if you can use the text variable that holds the input value. Reduce the code to two lines. Use one line for input and one line for printing.
It needs only one variable, text. Use that variable inside the print statement. Also use upper() to convert the value inside text to uppercase.
+ 2
Pranay PRASHANT NAIK where is your attempt?
+ 2
I don 't see a change. It should print the variable, text, so that the input value gets printed out. Make it print the value that is stored inside the text variable instead of printing the literal strings.
Example from Introduction to Python course:
budget = 200
print(budget)
Output to console:
200
It prints the value that is stored in the budget variable. Now do it similarly, but using text instead of budget. Additionally, you will have to convert text to uppercase by using upper() - much like you did in your code to convert "hello" to uppercase.
+ 1
text = input()
text_1="hello"
print("hello".upper())
text_2="nasa"
print("nasa".upper())
text_3="bmw"
print("bmw".upper())
+ 1
Try this in your program: replace "hello" with text (that is the variable named text).
+ 1
When learning how to write code as a beginner, and even as a professional, a great amount of time must be spent experimenting until you get it right. Be persistent and try different things. What's really nice about working with the computer is that you get immediate feedback whether it worked or not. Pay attention to error messages. Review the lessons. If my prior instructions were clear enough, then the program should work. Please show the updated code so I can see where it may need correction now.
+ 1
👍👍🙏
+ 1
Yes I will try
+ 1
Pranay PRASHANT NAIK
print(input().upper())
This is all you need
text = input()
print(text.upper())
Do not try to hard-code the text value.
0
Can anyone help me with this???
0
Can anyone send solution??
0
Help??
0
Can you atleast give me hint
0
Still not getting right??
0
Can anyone send solution?
0
text = input()
text_1="hello"
print("hello".upper())
text_2="nasa"
print("nasa".upper())
text_3="bmw"
print("bmw".upper())
0
this is the solution and it work perfect just include print and inside text.upper to convert input to uppercase
text = input()
#convert to uppercase
print(text.upper())
0
text = input()
#convertir a mayúsculas
text1 = text.upper()
#mostrar en la pantalla
print(text1)
0
text = input()
#convert to uppercase
Upper = text.upper()
#display on the screen
print (Upper)
Maybe, you can try.