+ 4
I am learning python and I have to solve this problem... Please help me
You’re given a task to write the word "hi" 42 times. Boring, right? Write a program to do it for you. Create a program to output "hi" 42 times, without any separators, on the same line. https://code.sololearn.com/cApZQ1v8379s/?ref=app
39 Respostas
+ 8
Use small p in Print, not capital P
print("hi"*42)
+ 24
It's easy‼️😀🤣 Just:
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
print("Hi", end="")
+ 4
Your try?
It's explained in lesson clearly... Revise it.
+ 4
#small thing it is:
s="hi"
print(s*42)
+ 3
I do it.. Thank you so much in deed I really appreciate
+ 3
Janusz Bujak 🇵🇱 🇺🇦
Excellent code. 😁👍
+ 3
Андрей Зализкий
Please create an own thread, mention the programming language and the task and link your code
+ 3
Андрей Зализкий CREATE YOUR OWN THREAD PLEASE.
To LINK your code:
Go to Code section, click +, select the programming language, insert your code, save. Come back to YOUR OWN THREAD, click +, Insert Code, sort for My Code Bits, select your code.
You need to read the task description carefully: If there are 2 example inputs, you need to write 2 input() and use them.
+ 2
Yes i know it is print("hi" *42)
+ 2
But they say undefined variable "print"
+ 2
Don't write anything else but print("hi"*42).
Link your complete code if you need help.
+ 2
Damn you made me laugh at myself🤣🤣🤣
+ 2
for i in range(42): print("Hi", i) 🤦
+ 2
Андрей Зализкий
1) Describe the complete task
2) Do not write anything inside input()
+ 2
Андрей Зализкий
Please try below code
x = input()
print(x * 10)
Hope I understood your task and able to help you
+ 1
Re-read the lesson – you find the answer there. Pay attention to how strings can be repeated
+ 1
Lisa thank you very much you are so kind
But i dont know how to share my code to let you help me
+ 1
A bug or you missing something..
Can you show it by saving in playground?
Close app and reopen then Try again once...
edit:
Nafee Riad Farah
This may help you, to share links 👇
https://www.sololearn.com/post/75089/?ref=app
+ 1
Below is the code that should work.
First_counter = 0
While first_counter < 42:
print(“hi”)
first_counter += 1
+ 1
You have to use the multiply symbol which is this * and create the string 42 and that should work btw it should look like this!
print("hi"*42)