How to solve this? Help me please with lesson 14.2 Python. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to solve this? Help me please with lesson 14.2 Python.

I can not decide, althought i write the code correctly... x = input("hi") y = int(input('5')) print(x*y) the task is to output x, y times. For example : hi 5 result: hihihihihi Even the tooltip says: x = input() y = int(input()) print(x * y) But still , that is it does not complete successfully! Sorry for my English, i learn) thank you for you help!

7th Jan 2023, 7:18 AM
Daniel Beknazarov
Daniel Beknazarov - avatar
4 Answers
+ 3
DO NOT put anything inside the parentheses for input() it will show up in output. Judge will see those and fail you because your code output things that are not required. Output MUST follow task requirement, nothing more, nothing less ...
7th Jan 2023, 7:46 AM
Ipang
+ 4
The code provided by the tooltip is correct and working. x is a string and y is a number. Python can multiply a string with a number, and it gives the expected result to repeat the string multiple times. I would suggest that you save your code attempt in the code playground separately and provide a link (insert your code here with the + button). Then people can have a look what could be wrong, also you can test it better and see any potential error messages. There might be a syntax error or wrong indentation.
7th Jan 2023, 7:47 AM
Tibor Santa
Tibor Santa - avatar
+ 2
thanks a lot guys!!! Everything worked out, I need to be more careful!
7th Jan 2023, 8:00 AM
Daniel Beknazarov
Daniel Beknazarov - avatar
0
نةىىه لغمك
9th Jan 2023, 12:23 AM
Mohamad El Maroni
Mohamad El Maroni - avatar