1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
liraira [26]
2 years ago
6

You are given an integer N where 0 <= N <= 100, followed by another line of input which has a word W with length L where 1

<= L <= 50. Your task is to print N lines with the word W. The lines of your output should not have any trailing or leading spaces.
Your output lines should not have any trailing or leading whitespaces

Input

3
Hello


Output

Hello
Hello
Hello
Computers and Technology
1 answer:
andreev551 [17]2 years ago
6 0

import math as m

def print_word(N, W, retries = 4):

for _ in retries:

if(N > 100 or N < 0 or len(W) > 50):

print("Number is out of range or word is too large. Try again.")

new_word = str(input("New word: "))

new_num = int(input("New number: "))

if(new_num >= 0 and new_num <= 100 and len(W) <= 50):

for row in new_num:

print(new_word)

return "Thank you for your time!"

if(N >= 0 and N <= 100 and len(W) <= 50):

for row in N:

print(W)

return "Thank you for your time!"

try:

N = m.floor(int(input("Enter a number from 0 to 100: " )))

W = str(input("Enter a word: "))

except ValueError:

print("Invalid Input!")

print(print_word(N,W))

You might be interested in
Write a function square_evens(values) that takes a list of integers called values, and that modifies the list so that all of its
Mice21 [21]

Answer:

#create the function

def square_evens(values):

   count_Value = 0

   #loop loop for iteration

   for i in values:

       #check for even number

       if (i) % 2 == 0:

           values[count_Value] = i * i  #store the square in the same index

       count_Value =count_Value + 1

   print(values)  #print the list

# list of integers

values = [1, 2, 3, 4, 5, 6]

#calling the function

square_evens(values)

Explanation:

The above code is written in python. first, create the function square_evens() which takes one parameter of the list.

inside the function declare the variable and then take a for loop for traversing each element in the list. Inside the for loop, we take the if-else statement for checking the number is even. if the number is even then stored the square of that value in the same list. To store the square value in the same index, we take the count variable for tracking the index.

After the all element in the list checked, the program terminates the loop and then print the updated list on the screen.

Outside the function, create the list with an integer value and then calling the function with passing the list argument.  

NOTE: In the python programming, please keep the indentation in code.

5 0
3 years ago
Define the terms candidate key and primary key. Explain the difference between a primary key and a candidate key.
Shkiper50 [21]

Explanation:

Both Primary Key and Candidate Key are the attributes that are used to access tuples from a table. These (Primary key and Candidate key) are also can be used to create a relationship between two tables.

  • A Candidate Key can be any column or a combination of columns that can qualify as a unique key in the database. Each Candidate Key can qualify as a Primary Key.
  • A Primary Key is a column or a combination of columns that uniquely identify a record. The primary key is a minimal super key, so there is one and only one primary key in any relationship.

<em> The main difference between them is that a primary key is unique but there can be many candidate keys. </em>

I hope you find this information useful and interesting! Good luck!

5 0
4 years ago
Which statement about trees is false?
anzhelika [568]

Answer:

The correct answer is A.

Explanation:

B is true if the two nodes are descending from the same parent node, they are called sibling nodes.

C is true, the nodes which do not have any nodes branching from them are called leaf nodes and mark the end of that specific branch.

D is true, a node tree is defined as nonlinear set of nodes growing downwards which are linked together.

The false option is A, a node in a node tree does not have to contain at least two links, it can be a leaf node.

I hope this answer helps.

6 0
4 years ago
Imaging a computer is part of what phase of conversion?
grandymaker [24]
B. Because the computer can rearrange itself when it is in a phase of conversion
5 0
3 years ago
When working in the navigation pane, you ____ a folder to open it?
SpyIntel [72]
When working in the navigation pane, you click a folder to open it
3 0
3 years ago
Other questions:
  • How to find determinant of ​
    15·1 answer
  • James gets a job at a multinational corporation. On his first day at work, he finds out that the numerical code assigned by the
    10·1 answer
  • [5]Suppose a 1,600 kg car is traveling at 20.0 m/s. What average force is needed to stop the car in 4.0 s?
    8·2 answers
  • Hey anyone wanna zoom.
    7·2 answers
  • Need help ASAP??? Pick the best answers
    10·1 answer
  • Who is Mr.Anonymous?
    5·2 answers
  • Three Cat 5e cables were run from an office area to three computers in a machine shop. Work took place on the weekend when the m
    14·1 answer
  • Select three advantages of cloud computing.
    12·1 answer
  • Example of vector image format​
    12·1 answer
  • Pieter is a network administrator for a growing company and has decided to implement Kerberos. He knows that Kerberos uses a tic
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!