Write the syntax.

1. for loop

2. while loop

3. function definition

4. function call

5. do while loop​

Answers

Answer 1

Answer:

Explanation:

The following syntax's are written in Python and perform a very basic arithmatic operation within the loop of call as an example

1.    for x in range(3):

       print(x)

2.    count = 0

      while True:

          print(count)

          count += 1

          if count == 4:

              return False

3. def next_pow2():

       return 3**2

4. next_pow2()

5. i = 1

while True:

   print(i)

   i = i + 1

   if(i > 3):

       break

#Python doesn't have an explicit do-while loop but can be emulated exactly as a do-while loop using the format written in answer 5.


Related Questions

Which of the following policy guidelines specifies the restrictions on user access
regarding access to read, write, execute, or delete permissions on the system?
Least privilege
Accountability
Default use
Specific duties

Answers

The policy guidelines that specifies such restrictions on user access can be referred to as: A. Least privilege.

What is the Least Privilege Principle?

The least privilege principle can be described as a concept in information security and policy guidelines that gives a user minimum permission or levels of access that they are needed to execute a tasks.

Therefore, the policy guidelines that specifies such restrictions on user access can be referred to as: A. Least privilege.

Learn more about least privilege on:

https://brainly.com/question/4365850

Which attitudes are most common among successful IT professionals?

Answers

openness to learning new things and interest in technology

emotional resilience and enjoyment of leadership positions

tough-mindedness and a focus on financial gain

empathetic and motivated by a concern for others


hopefully that helps!

how would you build a robot

Answers

Answer:

Use electric cables and build it with good strong metal

Explanation:

Answer:

use a lot of tech to assemble the robot

Explanation:

special purpose computer​

Answers

Answer:

Special-purpose computers are designed for one specific task or class of tasks and wouldn't be able to perform general computing tasks. For example, a router is a special-purpose computer designed to move data around a network, while a general-purpose computer can be used for this task, as well as many others.

Adam has decided to add a table in a Word doc to organize the information better. Where will he find this option? Insert tab, Illustrations group Insert tab, Symbols group Insert tab, Tables group Design tab, Page Layout group

Answers

He will have to navigate to the Insert Tab and then Click on Table option.

Answer:

C

Explanation:

What is the purpose of file extensions? A. They execute the mail merge function, B. They tell the operating system what kind of document you are creating. O C. They run the spelling checker and grammar checker features. D. They set up your files in an organized hierarchy.​

Answers

Answer:The answer is D

Explanation:just took it. hope it helps..

Answer: it’s not D it’s B

Explanation:

ape-x

Question #2
Multiple Choice
What is wrong, if anything, with this line of code?
>>> myDict = {'zapato', 'shoes
There should be parantheses around {zapatoshoe')
There should be a colon instead of a comma betueen zapato' and shoe
There is nothing wrong
O You should use double quotes around "zapato" and "shoe."

Answers

Answer:

There should be a colon instead of a comma between 'zapato' and 'shoe.'

Explanation:

Got it right on Edge 2020. <3

Write a program that rolls two dice until the user gets snake eyes. You should use a loop and a half to do this. Each round you should roll two dice (Hint: use the randint function!), and print out their values. If the values on both dice are 1, then it is called snake eyes, and you should break out of the loop. You should also use a variable to keep track of how many rolls it takes to get snake eyes.

Sample Run:

Rolled: 6 5
Rolled: 5 2
Rolled: 3 6
Rolled: 6 2
Rolled: 1 2
Rolled: 5 3
Rolled: 1 4
Rolled: 1 1
It took you 8 rolls to get snake eyes.

I have most of the code but when it prints it say you rolled 0 times every time.
import random

# Enter your code here

num_rolls = 0


import random
# Enter your code here

while True:

roll_one = random.randint(1,6)
roll_two = random.randint(1,6)
print ("Rolled: " +str(roll_one) +"," + str(roll_two))
if (roll_one == 1 and roll_two == 1):
print ("it took you " + str(num_rolls) + " rolls")
break

output:
Rolled: 3,5
Rolled: 6,4
Rolled: 2,4
Rolled: 3,6
Rolled: 5,2
Rolled: 1,1
it took you 0 rolls

suppose to say:
It took you (however many rolls) not 0

Answers

import random

num_rolls = 0

while True:

   r1 = random.randint(1, 6)

   r2 = random.randint(1, 6)

   print("Rolled: " + str(r1) + "," + str(r2))

   num_rolls += 1

   if r1 == r2 == 1:

       break

print("It took you "+str(num_rolls)+" rolls")

I added the working code. You don't appear to be adding to num_rolls at all. I wrote my code in python 3.8. I hope this helps.

The program uses loops and conditional statements.

Loops perform repetitive operations, while conditional statements are statements used to make decisions

The program in Python where comments are used to explain each line is as follows:

#This imports the random module

import random

#This initializes the number of rolls to 0

num_rolls = 0

#The following loop is repeated until both rolls are 1

while True:

   #This simulates roll 1

   roll_one = random.randint(1,6)

   #This simulates roll 2

   roll_two = random.randint(1,6)

   #This prints the outcome of each roll

   print ("Rolled: " +str(roll_one) +"," + str(roll_two))

   #This counts the number of rolls

   num_rolls+=1

   #When both rolls are the 1

   if (roll_one == 1 and roll_two == 1):

       #This exits the loop

       break

#This prints the number of rolls

print ("it took you " + str(num_rolls) + " rolls")

Read more about similar programs at:

https://brainly.com/question/14912735

I need help finishing this coding section, I am lost on what I am being asked.

I need help finishing this coding section, I am lost on what I am being asked.
I need help finishing this coding section, I am lost on what I am being asked.
I need help finishing this coding section, I am lost on what I am being asked.

Answers

Answer:

when cmd is open tell me

Explanation:

use cmd for better explanatios

Write a short story using a combination of if, if-else, and if-if/else-else statements to guide the reader through the story.


Project requirements:


1. You must ask the user at least 10 questions during the story. – 5 points

2. The story must use logic statements to change the story based on the user’s answer – 5 points

3. Three decision points must offer at least three options (if-if/else-else) – 5 points

4. Six of your decision points must have a minimum of two options (if-else) – 4 points

5. One decision points must use a simple if statement - 1 points

Answers

Here's an example implementation of the classes described:

How to implement the class

class Person:

   def __in it__(self, name, ssn, age, gender, address, telephone_number):

       self.name = name

       self.ssn = ssn

       self.age = age

       self.gender = gender

       self.address = address

       self.telephone_number = telephone_number

class Student(Person):

   def __in it__(self, name, ssn, age, gender, address, telephone_number, gpa, major, graduation_year):

       super().__in it__(name, ssn, age, gender, address, telephone_number)

       self.gpa = gpa

       self.major = major

       self.graduation_year = graduation_year

class Employee(Person):

    def __in it__(self, name, ssn, age, gender, address, telephone_number, department, job_title, hire_year):

super().__in it__(name, ssn, age, gender, address, telephone_number)      

   

class HourlyEmployee(Employee):

   def __in it__(self, name, ssn, age, gender, address, telephone_number, department, job_title, hire_year, hourly_rate, hours_worked, union_dues):

       super().__in it__(name, ssn, age, gender, address, telephone_number, department, job_title, hire_year)

       self.hourly_rate = hourly_rate

       self.hours_worked = hours_worked

       self.union_dues = union_dues

class SalariedEmployee(Employee):

   def __in it__(self, name, ssn, age, gender, address, telephone_number, department, job_title, hire_year, annual_salary):

       super().__in it__(name, ssn, age, gender, address, telephone_number, department, job_title, hire_year)

       self.annual_salary = annual_salary

Which code segment results in "true" being returned if a number is odd? Replace "MISSING CONDITION" with the correct code segment.

a) num % 2 == 0;
b) num % 2 ==1;
c) num % 1 == 0;
d) num % 0 == 2;

Which code segment results in "true" being returned if a number is odd? Replace "MISSING CONDITION" with

Answers

Answer:

Which code segment results in "true" being returned if a number is odd? Replace "MISSING CONDITION" with the correct code segment.

Explanation:

num % 2 ==1;

Select the qualification that is best demonstrated in each example.
Ginny carefully reviews the code in a program to make sure there are no errors.
Walker identifies why a program isn't working correctly and fixes it.
Donnell reviews code to help out a coworker who is in a hurry.
Hisako teaches herself a new programming technique.

Select the qualification that is best demonstrated in each example.Ginny carefully reviews the code in

Answers

Answer:

1. attention to detail

2.problem solving skills

3. teamwork

4. the ability to learn quickly

Explanation:

Answer:

2, 3, 2, 2

Explanation:

answer above was correct:)

5.4.2: While loop: Print 1 to N. Write a while loop that prints from 1 to user_num, increasing by 1 each time. Sample output with input: 4 1 2 3 4

Answers

Answer:

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

   System.out.println("Enter a number");

   int user_num = in.nextInt();

   int n = 1;

   while(n <= user_num){

     System.out.print(n+" ");

     n++;

   }

 }

}

Explanation:

Import Scanner to receive user numberCreate and initalize a new variable (n) to be printed outSet the while condition to while(n <= user_num)Print the value of n after each iteration and increment n by 1

Answer:

Written in Python:

i = 1

user_num = int(input()) # Assume positive

while i <= user_num:

   print(i)

   i += 1

Explanation:

More than one component in a particular automotive electric circuit is not working. Technician A starts testing the circuit at the power source. Technician B starts testing the circuit at its load. Who is right?

Answers

Hi there! Hopefully this helps!

--------------------------------------------------------------------------------------------------

The answer is A, testing the circuit at the power source.

9
Select the correct answer.
What is the purpose of flowcharts?
OA.
О в.
O C.
to depict objects and classes
to show the flow of data between functions
to show the relationships between data entities
O D. to provide a high-level description of code
O E. to represent algorithms graphically
Undo
Next
Edmentum/ Plato

9Select the correct answer.What is the purpose of flowcharts?OA. .O C.to depict objects and classesto

Answers

B. To show the flow of data between functions

Which of the following is not a characteristic of a good value log entry

Answers

What are we supposed to find? Help us

On the Audio Tools contextual tab, which tab will control how the audio file appears, if it appears, on the slide
itself?
A.) Bookmarks
B.) Playback
C.) Format
D.) Design

Answers

B is the correct answer

Answer:

Format

Playback doesn't show how it appears.

You are investigating a problem between two wireless bridges and you find that signal strength is lower than expected. Which of the following could cause the problem?

A. Wrong SSID

B. Incorrect 802.11 standard

C. Incorrect encryption key

D. Wrong antenna type

Answers

The most likely problem that led to the signal strength is lower than expected is a D. Wrong antenna type

What is a Computer Network?

This refers to the inter-connectivity between wireless bridges to connect a computer system to the world wide web.

Hence, we can see that based on the fact that there is troubleshooting going on about two wireless bridges where the signal strength is lower than expected, the most likely problem that led to the signal strength is lower than expected is a D. Wrong antenna type

Read more about computer networks here:

https://brainly.com/question/1167985

#SPJ1

Trish has bought a new computer that she plans to start on after a week

Answers

So what is the question my guy?

Which of the following can the reverse outlining technique help to identify? Select one.

Question 6 options:

Opportunities for humor


The quality of the author’s ideas


Improper citations


Overlap in ideas


Missing keywords

Answers

Answer:

The reverse outlining technique can help identify overlap in ideas.

What does it mean "Be Proactive"?

Answers

Answer:controlling a situation by making things happen or by preparing for possible future problems

Explanation:

Make things happen instead of waiting for them

Your organization allows employees to bring their own devices into work, but management is concerned that a malicious internal user could use a mobile device to conduct an insider attack.
Which of the following should be implemented to help mitigate this threat?

Answers

Create an AUP that outlines the locations and times that mobile devices are permitted to be used inside the company.

What should be in an AUP?

An acceptable usage guideline typically: includes explicit guidelines, like no video piracy. explains the repercussions of breaching the rules, such as warnings or access suspension. Describes how access is granted by an organization (for example, internet use is a privilege that can be revoked, rather than a right)

AUPs lower risk in what ways?

By restricting employee access to specific websites, an AUP can help lessen your business' vulnerability to cyberattacks. However, if your rules are overly stringent, it may have a negative impact on employee satisfaction, which may then have a negative impact on productivity and retention.

To know more about AUP visit:

https://brainly.com/question/2912406

#SPJ4

Which of the following is a function of an audio programmer?

Answers

Answer:function of audio programmer

1. The audio programmer at a game development studio works under to integrate sound into the game and write code to manipulate and trigger audio cues like sound effects and background music.

Your answer is D. to integrate sound and music into the game

Hope this helps you

According to the video, what types of education are useful for Database Administrators? Check all that apply.
high school degrees
college degrees
certification
communication workshops
Done
Intro

Answers

Answer:

b.college degrees

c.certification

Explanation:

The type of education useful for Database Administrators are college degrees and certifications. The correct options are b and c.

What are Database Administrators?

A database management system typically supports the platforms' administration, development, and use. A Relation Database Management System (RDBMS) is a category of Database Management System (DBMS) that includes a structure (row-based table) that connects data pieces as well as operations that are intended to ensure the data's accuracy, security, consistency, and integrity.

They are capable of doing this since they are familiar with database administration tools and technologies. Currently, one of the most sought-after jobs in America is database administration.

Hospitals, banks, and insurance corporations are a few examples. To put it another way, database administrators are in charge of creating, maintaining, and protecting your databases.

Therefore, the correct option is b. college degrees, and c. certification.

To learn more about Database Administrators, refer to the link:

https://brainly.com/question/13261952

#SPJ6

Type the correct answer in the box. Spell all words correctly.
Based on the given information, in which phase of the SDLC is Leigh involved?
Leigh works in an IT firm. She shows prototypes of software to clients. Leigh is involved in the
Undo
Next
phase of the SDLC.
Edmentum/ Plato

Type the correct answer in the box. Spell all words correctly.Based on the given information, in which

Answers

Leigh works in an it firm. she shows prototypes of software to clients. leigh is involved in the Implementation phase of the sdlc.

A project management model called the system development life cycle outlines the steps needed to take a project from conception to completion. For instance, software development teams use many models of the systems development life cycle, such as the waterfall, spiral, and agile methods.

The planning, system analysis, system design, development, implementation, integration, testing, and operations and maintenance phases of the systems development life cycle are included. When the goal of the system development life cycle is to create software applications, security is essential.

To know more about systems development life cycle (SDLC) , visit:

brainly.com/question/15696694

#SPJ1

What does influence mean in this passage i-Ready

Answers

In the context of i-Ready, "influence" refers to the impact or effect that a particular factor or element has on something else. It suggests that the factor or element has the ability to shape or change the outcome or behavior of a given situation or entity.

In the i-Ready program, the term "influence" could be used to describe how various components or aspects of the program affect students' learning outcomes.

For example, the curriculum, instructional methods, and assessments implemented in i-Ready may have an influence on students' academic performance and growth.

The program's adaptive nature, tailored to individual student needs, may influence their progress by providing appropriate challenges and support.

Furthermore, i-Ready may aim to have an influence on teachers' instructional practices by providing data and insights into students' strengths and areas for improvement.

This can help educators make informed decisions and adjust their teaching strategies to better meet their students' needs.

In summary, in the context of i-Ready, "influence" refers to the effect or impact that different elements of the program have on students' learning outcomes and teachers' instructional practices. It signifies the power of these components to shape and mold the educational experiences and achievements of students.

For more such questions element,Click on

https://brainly.com/question/28565733

#SPJ8

create survey result using microsoft excel with twenty 20 respondents teacher and student use another sheet of coupon bond

Answers

To create a survey result using Microsoft Excel. Here's a step-by-step guide:

Step 1: Open Microsoft Excel and create a new workbook.

Step 2: Rename the first sheet as "Survey Results" and the second sheet as "Coupon Bond."

Step 3: In the "Survey Results" sheet, create the following column headers in cells A1 to E1: "Respondent ID," "Name," "Role," "Question 1," and "Question 2."

Step 4: Enter the data for each respondent in columns A to E, starting from row 2. For example, enter the respondent ID in column A, name in column B, role in column C, and the responses to question 1 and question 2 in columns D and E, respectively. Repeat this process for all 20 respondents.

Step 5: In the "Coupon Bond" sheet, you can design the coupon bond as per your requirements. Add text, graphics, or any other formatting elements as desired. You can use the drawing tools in Excel to create a visually appealing design.

Step 6: Print the "Coupon Bond" sheet onto a coupon bond paper.

Now created a survey result using Microsoft Excel with the data stored in the "Survey Results" sheet and a separate sheet containing the coupon bond design.

Learn more about Microsoft Excel on:

https://brainly.com/question/30750284

#SPJ1

What should a valid website have?

Select one:
a. Cited sources, copyright, and a clear purpose
b. Cited sources, copyright, and a poor design
c. Cited sources, copyright, and colorful images
d. Cited sources, no copyright, and a broad purpose

Answers

Answer:

A. cites sources,copyright,and a clear purpose

write a function that given an integer Y and 3 non-empty string A,B,W, denotingthe year of vacations, the beginning month, the end month and the day of the week for 1st January of that year

Answers

Answer:un spain please

Explanation:

true or false. Two of the main differences between storage and memory is that storage is usually very expensive, but very fast to access.​

Answers

Answer:

False. in fact, the two main differences would have to be that memory is violate, meaning that data is lost when the power is turned off and also memory is faster to access than storage.

Other Questions
Which type of misrepresentation persuades an insured? what is the background information of monsoon in India Graph the solution of the inequality.3.5 how many moles of ethylene glycol (c2h6o2) are needed to mix with 5.00 kg of water to prepare a 3.50 m solution? Where does the energy for most ecosystems originate? How is this converted into the energy in food? What do tailors, seamstresses, and sewists have in common?They all work with cloth.They all design women's clothes.They all alter clothes.They all design men's clothes. What is the resulting equation when the expression for y in the second equation is substituted into the first equation? 3x y = 1 y = 6 - 4x -x 6 = 1 x 6 = 1 7x 6 = 1. A farmer can be served in a public library,true or false? Which is the best way to improve this paragraphs sentence fluency? A 615 N student standing on a scale in an elevator notices that the scale reads 645 N. From this information, the student knows that the elevator must be movinga) downwardsb) upwardsc) you cannot tell if it is moving upward or downward. I thought the answer would be B but it says it is C Oliver had to wash thirty-nine short sleeve shirts and forty-seven long sleeve shirts before school. If he had only washed twenty of them by the time school started, how many did he not wash? Given f (x) = 6x175 6 (a) Find the intervals on which fis increasing or decreasing. (b) Find the relative maxima and relative minima off. What book did Frederick Douglass andAbraham Lincoln BOTH read as young men? Segment AB is shown on the graph.6543-(-3,2)A2-7-6-5-4-3-2-1-2No + p q r-34-5-62 3 4 5 6 7 XB (2,-1)Which shows how to find the x-coordinate of the pointthat will divide AB into a 2:3 ratio using the formulaa= (a + b )(x ] + x ?O x =(-3-2) +2Ox=(2+3)-3Ox=(-3-2) +2Ox=(2+3)-3 A Corgi is crossed with a Labrador, which has normal long legs. Both Corgi's andBeagles can have short or long ears. Long ears are dominant over short ears. If a Corgithat is heterozygous for leg height and ear length is crossed with a normal height B thathas short ears, what is the probability of a long leg, long ear offspring Use a dihybridcross to support your response, which may be expressed as a ratio. What is the product of 329 and 65 5. What is the number of nearest neighbors or coordination number, CN, for a fcc metal? Why is the unit cell less useful in determining the CN versus bcc? A business wants to evaluate their campaign, and specifically wants to look at how much they spent for a customer to take an action. This measurement would be true or false: distributed product development is producing a firm's product without the help of other organizations. How is an equilibrium price determined?A. By finding a price that meets the highest quantity demanded byconsumersB. By finding a price that exceeds the expenses producers take on tocreate supplyC. By finding a price that meets the highest quantity supplied byproducersD. By finding the price where quantity supplied matches quantitydemanded