+ 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

22nd Sep 2023, 5:32 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
20 Antworten
+ 8
Use .upper() function.. Please show us your attempt, even though it's not completed..
22nd Sep 2023, 5:34 AM
Dragon RB
Dragon RB - avatar
+ 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.
22nd Sep 2023, 7:05 AM
Brian
Brian - avatar
+ 2
Pranay PRASHANT NAIK where is your attempt?
22nd Sep 2023, 6:36 AM
Brian
Brian - avatar
+ 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.
22nd Sep 2023, 8:32 PM
Brian
Brian - avatar
+ 1
text = input() text_1="hello" print("hello".upper()) text_2="nasa" print("nasa".upper()) text_3="bmw" print("bmw".upper())
22nd Sep 2023, 6:38 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
+ 1
Try this in your program: replace "hello" with text (that is the variable named text).
22nd Sep 2023, 7:56 AM
Brian
Brian - avatar
+ 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.
22nd Sep 2023, 1:22 PM
Brian
Brian - avatar
+ 1
👍👍🙏
22nd Sep 2023, 2:34 PM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
+ 1
Yes I will try
22nd Sep 2023, 2:34 PM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
+ 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.
22nd Sep 2023, 10:41 PM
BroFar
BroFar - avatar
0
Can anyone help me with this???
22nd Sep 2023, 5:33 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
0
Can anyone send solution??
22nd Sep 2023, 6:25 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
0
Help??
22nd Sep 2023, 7:04 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
0
Can you atleast give me hint
22nd Sep 2023, 7:28 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
0
Still not getting right??
22nd Sep 2023, 10:05 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
0
Can anyone send solution?
22nd Sep 2023, 10:05 AM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
0
text = input() text_1="hello" print("hello".upper()) text_2="nasa" print("nasa".upper()) text_3="bmw" print("bmw".upper())
22nd Sep 2023, 7:08 PM
Pranay PRASHANT NAIK
Pranay PRASHANT NAIK - avatar
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())
24th Dec 2023, 4:37 PM
Awais Mahboob
Awais Mahboob - avatar
0
text = input() #convertir a mayúsculas text1 = text.upper() #mostrar en la pantalla print(text1)
30th Jan 2024, 1:44 PM
Cesar Rodriguez
Cesar Rodriguez - avatar
0
text = input() #convert to uppercase Upper = text.upper() #display on the screen print (Upper) Maybe, you can try.
16th Jul 2024, 4:25 AM
Billy Gozali
Billy Gozali - avatar