By one line, what I mean is something like the output of this Ruby code:
def ask()
puts("What is your name?")
name = gets().chomp
if (name == "Tilly")
puts("Awesome name!")
else
print("#{name} is a ")
index = 0
while (index < 50)
print("silly ")
index += 1
end
puts("name!")
end
end
ask()
Basically, I don't want a new line for each time the word silly is printed. Here's the Python code:
name = input("Welcome! Enter your name. ")
print(name, "is a")
i = 0
while (i < 50):
print("silly")
i = i + 1
print("name!")
How do I fix this? In Ruby, there is print() for situations like this, and puts() for everything else. Python doesn't seem to have anything like this. Please be gentle, this is my first ever Python program.