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
solniwko [45]
3 years ago
12

Convert the following code segments as instructed.

Computers and Technology
1 answer:
Kruka [31]3 years ago
3 0

Answer:

Following are the code to this question:

For point a:

value=7#defining a variable value that holds an integer value

if(value>0 and value<10):#use if block with and operator to check the value

print("did it")#print message

For point b:

my_str="not_password"#defining a variable my_str that holds string value

if (len(my_str) > 0):#defining if block that checks string variable length is greater than 0  

   if (my_str!= "password"):#defining if block to check my_str is not equal to another given value

       print("did it")#print message

For point c:

my_str="not_password"#defining a variable my_str that holds string value

if (len(my_str) > 0):#defining if block that checks string variable length is greater than 0

   print("did it")#print message

elif (my_str!="password"):#use elif block to check my_str is not equal to another given value

   print("did it")#print message

Output:

did it

did it

did it

Explanation:

Please find the complete and the correct question in the attached file.

In point a, the "value" variable is defined, that holds an integer value , and it uses if block with "and" operator to check the value is greater than 0 and less than 10, and at the last, it will print the message "did it".

In point b, the "my_str" variable is declared, that holds a string value , and use the multiple if block in this, it checks the length is greater than 0, and in another, if it checks its "my_str" value is not equal to another given value, and it prints the message "did it".

In point c, the "my_str" variable is declared, that holds a string value , and use the if block, it checks the length is greater than 0, it will print the message "did it".  In the elif block, it checks "my_str" value is not equal to another given value, and it prints the message "did it".

You might be interested in
What is a BUG in terms of computer programming?
diamong [38]

Answer:

C

Explanation:

4 0
3 years ago
A copy machine is available 24 hours a day. On a typical day, the machine produces 100 jobs. Each job takes about 3 minutes on t
Hoochie [10]

Answer:

13.3%

Explanation:

OEE= Availability × Performance × Quality

Availability = Run Time/ Planned Production Time

Run time = 3*100 = 300 + 0.2* 300 = 1.2 *300 = 360 mins

Planned Production time = 24*60 = 1440 mins

Availability = 360/1440 = 1/4 = 25%..............1

Performance = (Ideal Cycle Time × Total Count) / Run Time

Ideal Cycle Time = 2 min (Only the processing time)

Total Count= 100+20 = 120

Performance = 2*120/360 =66.67% .............2

Quality = 100%-20% = 80%.......3

Frpm 1,2,3

OEE=25% * 66.67 % * 80% =

0.13334=13.3%

4 0
4 years ago
________ a file transfers a copy of the file from the storage media into your computer memory
frez [133]
Is coping one of the answers? If so, I would say that.
6 0
3 years ago
Which property do you use to align an element horizontally with the left or right edge of its parent element?
Ugo [173]
A thank me later:) give me hearts
3 0
3 years ago
Which of the following is not an acceptable way to code a nested structure? Select one: a. nest a for loop inside a while loop b
kirill115 [55]

Answer:

nest an else clause within an elif clause

Explanation:

in python Programming, we cannot nest an else clause within an elif clause. elif is actually else if condition. we cannot nest another else with in elif clause.

8 0
3 years ago
Other questions:
  • When advising a customer on the purchase of a new power supply, you should explain that if the power supply runs at peak perform
    9·1 answer
  • What is the most common drive letter where window stores most data and programs. 1,a 2,b 3,c 4,e
    9·1 answer
  • Write a Bash script that takes the name of a file or directory as an argument, 1. reports if it is a directory or a file, and if
    14·1 answer
  • An object reference is required for the nonstatic field method or property True or False
    11·1 answer
  • Some in the security community argue that a lack of diversity is security vulnerability. For example, Firefox and Internet Explo
    6·1 answer
  • Which of the following are provided by most professional organizations
    11·1 answer
  • Which feature should be used prior to finalizing a presentation to ensure that audience members with disabilities will be able t
    13·2 answers
  • What is artificial Intelligence ?
    11·2 answers
  • Write a program to find a perimeter of rectangle using SUB.. ..End SUB​
    14·2 answers
  • The pci express version 4.0 can provide up to what amount of throughput with 16 lanes for data?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!