Question
Asked Feb 27, 2019
31 views

I have a Python question and I cannot seem to figure out how to answer this problem exactly (I've attached an example of what the answer should look like-- the picture is to a different problem) :

1. What will be displayed when the following pseudocode is implemented?

  • set the variable equal to 0
  • repeat the following steps as long as N is less than 4
    • display 2 to the power N
    • set N equal to N + 1
  • display 2 to the power (N + 1) 
while Example #2
N=1
while N< 10:
print (N* *2)
N=N+3
1
16
49
while example 2.py
help_outline

Image Transcriptionclose

while Example #2 N=1 while N< 10: print (N* *2) N=N+3 1 16 49 while example 2.py

fullscreen
check_circle

Expert Answer

Hey..

To print the power of 2 you have to use a  power function  "pow(2,N) " .

It is inbuild function and you can use it with loading  python   "math"  ...

fullscreen

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: What is a program

A: A program is a set of instructions that a computer performs. A program contains a sequence of instru...

question_answer

Q: Cell Phones Records In this part, you are required to write a program, using linked lists, that man...

A: In the given question, some parts of the question are missing to use linked lists.Here, I have creat...

question_answer

Q: Create the physical level ERD.  I believe my physical level ERD is missing several parts. However, t...

A: Hey.....The actual design of database can be represented  by  physical E- R   diagrams.Physical ERD ...

question_answer

Q: Read in 5 numbers from the keyboard and, if any of the entered numbers is &lt; 0, then print out “Ne...

A: Pseudo code is given below to read five numbers from the keyboard and print “Negative” if the number...

question_answer

Q: 1.6 Compute the scalar cardinality and the fuzzy cardinality for each of thefollowing fuzzy set.

A: The scalar cardinality of a fuzzy set is calculated using the formula:

question_answer

Q: For the following problem please write an algorithm in plain English .i.e give details as to how you...

A: Algorithm to arrange the deck of 52 cards for the given scenario is as follows:  

question_answer

Q: What is the output of the following code: public class A{public int methodOfA(int i){i += 10;return ...

A: Given program:File name: A.java

question_answer

Q: Thank you!C++ please

A: First we'll create a LinkedList class.Below is the code for the LinkedList class:-class LinkedList{p...

question_answer

Q: The speed of computers has increased greatly over the history of computing. The traveling salesman p...

A: TSP is an NH Hard problem, if solved by brute force method it takes (n-1)! time where n is the size ...