Question

python beginner question! Hello, i am trying to allign the two variable below next to each...

python beginner question!
Hello, i am trying to allign the two variable below next to each other using a for loop, like this table below:
1 3
2 7
3 1
4 2
5 0
heres the code I use: 
balls = [1,2,3,4,5]
count = [3,7,1,2,0]
for j in numbers:
    print("{:}".format(j))
for i in count:
    print('{:10}'.format(i))

but the output looks like this:

1
2
3
4
5
3
7
1
2
0

i need my output to look like the first table, thank you for the help

0 0
Add a comment Improve this question Transcribed image text
Answer #1
balls = [1,2,3,4,5]
count = [3,7,1,2,0]
for i in range(len(balls)):
    print("{:} {:}".format(balls[i],count[i]))

Add a comment
Know the answer?
Add Answer to:
python beginner question! Hello, i am trying to allign the two variable below next to each...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python Problem Hello i am trying to finish this code it does not save guesses or...

    Python Problem Hello i am trying to finish this code it does not save guesses or count wrong guesses. When printing hman it needs to only show _ and letters together. For example if the word is amazing and guess=a it must print a_a_ _ _ _ not a_ _ _ _ and _a_ _ _ separately or with spaces. The guess has a maximum of 8 wrong guesses so for every wrong guess the game must count it if...

  • Hello, In Python, I am trying to create a function that will return the domain name...

    Hello, In Python, I am trying to create a function that will return the domain name from any inputted email address. For example, my input of [email protected] would return just the domainname. It needs to be done using regular expressions and the map function. I'm still stuck on trying to get the correct parameters for regular expression and also what is throwing it off. Thank you for your help! I am currently working with a list of different email addresses...

  • In python, PART A: I am trying to get a dictionary with size(4, 5, 6) as...

    In python, PART A: I am trying to get a dictionary with size(4, 5, 6) as keys and an array for key containing a list of values (words from file of respective size) associated with those keys I am reading from a file of strings, where I am only interested with words of length 4, 5, and 6 to compute my program reading the text file line by line: At first, I have an empty dictionary then to that I...

  • Python: Could you please say step by step how the output is coming? I understand about...

    Python: Could you please say step by step how the output is coming? I understand about importing and getting random number but how the inner loop is working? Code: import random li1 = [[random.randrange(5) for i in range(3)] for j in range(4)] print("First output : {}".format(li1)) ncol = 4 nrow = 5 li2 = [ [random.randrange(2) for i in range(ncol) ] for j in range(nrow) ] print("Second output : {}".format(li2)) Output: First output : [[3, 2, 4], [2, 3, 2],...

  • Hello, how should the code be if I want the output to be like in the...

    Hello, how should the code be if I want the output to be like in the image? it is python 3.7 For example: Test Result print numbers(00 print numbers(3) 0 1. 2

  • Need in Python! Consider the following program and expected output. Rewrite it using a for loop...

    Need in Python! Consider the following program and expected output. Rewrite it using a for loop and a conditional break statement such that it has the same output.   HINT: Stay with i as the main loop counter and let j control the break behavior.   i = 0 while i < 10 and j < 10 : j = i * 2 print(i, j) i += 1 # Output below, for reference - not part of the program! 0 0 1...

  • Hello, I am having trouble with a problem in my C language class. I am trying...

    Hello, I am having trouble with a problem in my C language class. I am trying to make a program with the following requirements: 1. Use #define to define MAX_SIZE1 as 20, and MAX_SIZE2 as 10 2. Use typedef to define the following struct type: struct {     char name[MAX_SIZE1];     int scores[MAX_SIZE2]; } 3. The program accepts from the command line an integer n (<= 30) as the number of students in the class. You may assume that the...

  • Hello, I am trying to solve the following problem using python: Assignment 3: Chatbot A chatbot...

    Hello, I am trying to solve the following problem using python: Assignment 3: Chatbot A chatbot is a computer program designed to emulate human conversation. For this program you will use if statements, user input, and random numbers to create a basic chatbot. Here is the scenario: You have decided to start an online website. You are creating a prototype to show investors so you can raise money and launch your website. You should ask the user at least 5...

  • python: how would I format the grid below so that it is aligned correctly? as you...

    python: how would I format the grid below so that it is aligned correctly? as you see, I tried to center it but it is still not correct. import random row=random.randint(1,10) col=random.randint(1,10) for r in range(row): for c in range(col): if r %2==0 and c %2==0: print(format('a','^3'),end=' ') elif r %2!=0 and c %2!=0: print(format("/x\\",'^3'),end=' ') elif c%2!=0: print(format('-','^3'),end='')    else: print(format('s','^3'),end=' ')    print() #go to next line current Output is: (example if random function choses col=4 and row=3)...

  • ZYBOOKS LAB: 10.23.1 Hello, I'm trying to solve this problem with creating a program code in...

    ZYBOOKS LAB: 10.23.1 Hello, I'm trying to solve this problem with creating a program code in Python about People's Weights. Here is the question: 10.23 LAB: Warm up: People's weights (Lists) (1) Prompt the user to enter four numbers, each corresponding to a person's weight in pounds. Store all weights in a list. Output the list. (2 pts) Ex: Enter weight 1: 236.0 Enter weight 2: 89.5 Enter weight 3: 176.0 Enter weight 4: 166.3 Weights: [236.0, 89.5, 176.0, 166.3]...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT