Linked Questions

394 votes
14 answers
1.3m views

I have some code like: score = 100 name = 'Alice' print('Total score for %s is %s', name, score) I want it to print out Total score for Alice is 100, but instead I get Total score for %s is %s Alice ...
user1985351's user avatar
  • 4,719
6 votes
6 answers
9k views

There is an extra space in the output of a string. This is the section of the code where it happens. It happens in the string of the function, nameConfirmation(). def chooseName(): name = "" ...
Destiny's user avatar
  • 65
0 votes
4 answers
29k views

I'm new to python and learning how to code. I'm printing last element of my list and sum of the list as- print list[-1],sum But the output is separated by " " and not separated by ",". Any idea how ...
Alex's user avatar
  • 21
1 vote
6 answers
9k views

I am trying to print a text with the name too. from faker import Faker fake = Faker() name = fake.name() print(name) but i want it to print some plain text as well in that print. like Hello, my name ...
Johnyy's user avatar
  • 11
0 votes
2 answers
13k views

I'm very new to python and I am making a text based game. In the start I ask the users name. How would I add what the user input to when I "print"? print ("Welcome to my first game! It's not much but ...
Marc Spiegel's user avatar
-5 votes
5 answers
2k views

say str(q)=hello str(w)=332 str(e)=nasa str(r)=21 What should I do in order to print <hello,332,nasa,21>? Note that brackets and commas are required
Peter Jiang's user avatar
0 votes
3 answers
188 views

C++ std::cout << "Hello world!"; // output: Hello world! Python print("Hello world!") # output: Hello world! That works. But how can I do this in Python? std::string name = "Robert"; std::...
Jeroen's user avatar
  • 57
0 votes
2 answers
751 views

I started learning Python and playing around with functions. students = ["Peter", "Mary", "George", "Emma"] student_ages = [24, 25, 22, 20] student_gpa = [3.1, ...
Helene's user avatar
  • 49
0 votes
2 answers
213 views

Not sure if this is asked before but: How do you print "searching for x" where "x" is a random integer? I have my code below: from random import randint numbers = [] random = ...
Melodyyyyy's user avatar
-4 votes
1 answer
112 views

Ok so I'm working on a problem in my python class. I've gotten most of it figured out aside from print statements. I assigned the arguements correctly (I think) and am just trying to get the text to ...
ToadPacShakur's user avatar
0 votes
0 answers
81 views

Objective I have a string variable: use_this_string = "If you want to <something here>, then first learn it" and I want to insert a user input value into it like (in REPL mode): >&...
The Assignment Nerd's user avatar
0 votes
1 answer
77 views

Experts, i want to print a range of values with steps 1.5, and after that i want another float value (10.0) to be print just beside the result of first function .In order to do that i tried the below ...
user avatar
-1 votes
1 answer
62 views

name = input('enter the name of the coustomer : ',), days = int(input('enter the number of days for :')) I want to print name after the text enter the number of days for (name) (type by user )
asdf's user avatar
  • 1
-2 votes
1 answer
50 views

For example, if I do this: for i in '12345': print("Welcome",i,"times") It outputs: Welcome 1 times Welcome 2 times Welcome 3 times Welcome 4 times Welcome 5 times But I want it like this: ...
DanONS's user avatar
  • 215
-1 votes
1 answer
61 views

I wanted to implement the formula for calculating speed into Python: def speed(): distance = input("What is the total distance? ") time = input("What is the total time taken to ...
luka's user avatar
  • 1

15 30 50 per page