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
Vadim26 [7]
2 years ago
11

4.8 Code Practice: Question 1

Computers and Technology
2 answers:
Semmy [17]2 years ago
6 0

Answer:

for x in range(1, 16):

   print(x * 5, end=" ")

Explanation:

Hope this helps!

Furkat [3]2 years ago
4 0

Answer:

c = 1 # global variable

    jhjl jh

def add(): c = 1 # global variable

def add():

   print(c)

add()

   c = c + 2 # increment c by 2

   print(c)

add()

Explanation:

You might be interested in
In c please
Paraphin [41]

Answer:

#include <stdio.h>

#include <ctype.h>

void printHistogram(int counters[]) {

   int largest = 0;

   int row,i;

   for (i = 0; i < 26; i++) {

       if (counters[i] > largest) {

           largest = counters[i];

       }

   }

   for (row = largest; row > 0; row--) {

       for (i = 0; i < 26; i++) {

           if (counters[i] >= row) {

               putchar(254);

           }

           else {

               putchar(32);

           }

           putchar(32);

       }

       putchar('\n');

   }

   for (i = 0; i < 26; i++) {

       putchar('a' + i);

       putchar(32);

   }

}

int main() {

   int counters[26] = { 0 };

   int i;

   char c;

   FILE* f;

   fopen_s(&f, "story.txt", "r");

   while (!feof(f)) {

       c = tolower(fgetc(f));

       if (c >= 'a' && c <= 'z') {

           counters[c-'a']++;

       }

   }

   for (i = 0; i < 26; i++) {

       printf("%c was used %d times.\n", 'a'+i, counters[i]);

   }

   printf("\nHere is a histogram:\n");

   printHistogram(counters);

}

5 0
2 years ago
Indentation is useful to make the document easier to read. To increase the indentation of the paragraph, you press the increase
jeka94

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The correct answer is Home.

Indentation is useful to make the document easier to read. To increase the indentation of the paragraph, you press the increase indentation in the   <u>Home</u> tab.

you can increase/ decrease indentation in Home tab under the Paragraph groups of command.

Othe options are not correct because:

View tab has settings related to how the document looks like. Insert tab has settings related to the insertion of image, shape, pages, tables, illustration, and links, etc into a document. The review tab allows you to review the document with different available settings.

4 0
3 years ago
Write the code to produce a for loop that counts down from 20 to 0 by 2’s and prints the number each time it goes through the lo
yulyashka [42]

Explanation:

Count-controlled for loop (Three-expression for loop)

This is by far the most common type. This statement is the one used by C. The header of this kind of for loop consists of a three-parameter loop control expression. Generally it has the form:

for (A; Z; I)

A is the initialisation part, Z determines a termination expression and I is the counting expression, where the loop variable is incremented or dcremented. An example of this kind of loop is the for-loop of the programming language C:

for (i=0; i <= n; i++)

This kind of for loop is not implemented in Python!

Numeric Ranges

This kind of for loop is a simplification of the previous kind. It's a counting or enumerating loop. Starting with a start value and counting up to an end value, like for i = 1 to 100

Python doesn't use this either.

Vectorized for loops

They behave as if all iterations are executed in parallel. This means, for example, that all expressions on the right side of assignment statements get evaluated before the assignments.

Iterator-based for loop

Finally, we come to the one used by Python. This kind of a for loop iterates over an enumeration of a set of items. It is usually characterized by the use of an implicit or explicit iterator. In each iteration step a loop variable is set to a value in a sequence or other data collection. This kind of for loop is known in most Unix and Linux shells and it is the one which is implemented in Python.

Example of a simple for loop in Python:

>>> languages = ["C", "C++", "Perl", "Python"]  

>>> for x in languages:

...     print(x)

...  

C

C++

Perl

Python

>>>

3 0
3 years ago
PLS HURRY!!<br> Look at the image below
Crank

The output will be 10.

The while loop runs until numb is equal to or less than 13.

25 - 5 = 20

20 - 5 = 15

15 - 5 = 10, which is less than 13 so the loop stops and 10 is printed to the screen.  

4 0
3 years ago
A bowl contains 20 candies; 15 are chocolate and 5 are vanilla. You select 5 at random. What is the probability that all 5 are c
Sindrei [870]

Answer: 0.1937

Explanation:

Given : A bowl contains 20 candies; 15 are chocolate and 5 are vanilla.

If we select 5 candies, then the number of ways to select them is given by permutations.

The number of ways to select 5 candies is given by :-

^{15}P_5=\dfrac{15!}{(15-5)!}=\dfrac{15\times14\times13\times12\times11\times10!}{10!}=360360

The number of ways of selecting any 5 candies out of 20:-

^{20}P_5=\dfrac{20!}{(20-5)!}\\\\=\dfrac{20\times19\times18\times17\times16\times15!}{15!}\\\\=1860480

Now, the probability that all 5 are chocolate :-

=\dfrac{360360}{1860480}=0.193691950464\approx0.1937

Hence, the probability that all 5 are chocolate =0.1937

5 0
3 years ago
Read 2 more answers
Other questions:
  • While in slide show mode, if you are not careful you can close the application by clicking the x on the menu bar. question 38 op
    12·2 answers
  • Write a code segment that displays the values of the integers x, y, and z on a single line, such that each value is right-justif
    11·1 answer
  • Which principle of design does a designer apply when they create rhythmic movement in a garment by using recurring pleats or det
    13·1 answer
  • (5 points) Create a user-defined data structure (i.e., struct) called Point that represents a two-dimensional Cartesian coordina
    5·1 answer
  • Stuart wants to delete some text from a slide. What should Stuart do?
    8·1 answer
  • Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
    13·1 answer
  • What is NOT a built-in function in python?<br> sqrt()<br> string()<br> fabs()<br> O print()
    12·2 answers
  • Laptop computers use PCMCIA cards, another type of ________
    15·1 answer
  • How does the issue of cybersecurity relate to the internet of things?.
    5·1 answer
  • Difference between copy command and cut command
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!