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
Nookie1986 [14]
3 years ago
13

Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user wil

l enter a number. The program should generate a ladder of X wherein the level depends on the number entered and the character should dictate whether it faces right or left.
Sample:

Character is r
Number is 3

Output
X
XX
XXX

Character is r
Number is 6
X
XX
XXX
XXXX
XXXXX
XXXXXX

Character is l
Number is 5

X
XX
XXX
XXXX
XXXXX
Computers and Technology
1 answer:
zvonat [6]3 years ago
7 0
Define variables
left is l
right is r

Ask input
left or right

Ask input value

Equate l or r to the input value

Show ladder with steps equal to input value and in the side of input variable
You might be interested in
Help debugging line 7 type error more arguments (5) than expected (1)
kolezko [41]

Answer:

import random

score = 0

for i in range(5):

   num1 = random.randint(1, 100)

   num2 = random.randint(1, 100)

   prompt = "What is " + str(num1) + "+" + str(num2) + "?"

   answer = int(input(prompt))

   result = (num1, num2)

   if answer == result:

       print("Well done!")

       score += 1

   else:

       print("incorrect")

print("Your score was", score)

Explanation:

Your error is on <em>line 7</em>, where you are providing multiple arguments to the input function, instead of 1.

One way to solve this is to create a variable prompt and concatenate all strings and variables within that variable to use for the input.

3 0
1 year ago
You may declare an unlimited number of variables in a statement as long as the variables are ____.
k0ka [10]

Answer:

b. the same data type

Explanation:

Any number of variables can be declared in a statement as long as the variables have the same data type. For example:

1) int a,b,c,d,e;

Here each of the declared variables a,b,c,d,e have the type int.

2) char p,q,r,s,t,u,v,w;

In this case variables p to w all have the type char.

3) float x,y,z;

x,y and z are all of type float.

6 0
4 years ago
How do Europe and North America address the challenges of jurisdiction when a computer crime involves both continents?
Anastasy [175]

Answer:

A. Treaties

Explanation:

Based on the information provided within the question it can be said that in this type of situation where both countries are affected they usually enter into a treaty. This treaty represents an agreement between both countries on how they are going to handle the situation so that both countries get the justice that they want and therefore mutually benefit.

4 0
3 years ago
Choose the 3 Points in good story telling
Sidana [21]

Answer:

1.Choose a clear central message 2. Embrace conflict 3.Have a clear structure  

Explanation:

8 0
2 years ago
Convert the decimal number -12 to hexadecimal (2's complement)
Helga [31]

Answer:

FFF4

Explanation:

Binary representation of 12 = 00001100

Expressing it in hexadecimal format : 0C

Binary representation of -12:

Step 1 : Computing 1's complement for 12 =11110011

Step 2 : Adding 1 to 1's complement to get the 2's complement =>

11110011+1 = 11110100

Converting the 2's complement representation to hexadecimal format:

F4 ( 8 bit representation) or FFF4 ( 16 bit representation)

4 0
4 years ago
Other questions:
  • Which button do you use to put data in a specific order A.Insert
    6·2 answers
  • A digital device Select one: a. uses electricity to run it. b. uses symbolic representations of data in the form of code. c. req
    7·1 answer
  • Which of the following is ideal for long distance communication ?
    5·1 answer
  • Which line of code will print I can code on the screen?
    13·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    6·1 answer
  • PLZ ANSWER ALL MY QUESTION. Which line of code will display the variable num rounded to the nearest tenth?
    14·1 answer
  • How does Accenture help companies harness the power of data to achieve optimal business outcomes?
    9·2 answers
  • Tools used to type text on Ms -paint​
    10·1 answer
  • Please help me with this question<br>it on the picture​
    9·1 answer
  • he memory protection requirement must be satisfied by the operating system rather than the processor. True False
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!