. Create a python script to print "hello, world!” four times.
Answers
Answered by
20
Program:
print("hello, world!\n" * 5)
Explanation:
- if you know the range in python it is very easy to print without using loops
- here you asked to print "hello, world!" string 5 times,without using loop we can print it by multiplying it inside the print statement
- so that print statement prints "hello, world" 5 times
- there is not need of using loops for this smaller code
----Hope you liked my code,if you liked it mark as brainliest,it would really help me. :)
Answered by
0
Answer:
Program:
print("hello, world!\n" * 5)
Explanation:
- Without using loops, printing in Python is really simple if you know the range.
- Without requiring a loop, we may print the string "hello, world!" five times by multiplying it inside the print expression.
- hence, the print command outputs "hi, world" five times.
- Consequently, "hello, world" is printed five times by the print command.
How can I print a Python hello world program:
Python Program to Print Hello World Result Image
Passing a string to the print() method is the easiest way to print Hello World in Python. The string "Hello World" will now be assigned to a variable, which will subsequently be sent to the print() method.
How can you say print show Hello World in Python simply:
Code of Source
"Hello, world!" is printed. Hello, universe! The string Hello, world! was printed on the screen using the program's built-in print() method.
Similar questions
English,
6 months ago
Computer Science,
6 months ago
Hindi,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago