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
Elodia [21]
3 years ago
7

What is branching in Python​

Computers and Technology
1 answer:
timama [110]3 years ago
6 0

Answer:

Branching is where a program decides whether to do something or not.

You might be interested in
Jin needs to add a row into his spreadsheet, but he does not want to remove any existing data. Which combination of options shou
disa [49]

Answer:

b. insert > entire row

5 0
3 years ago
Read 2 more answers
7.6 LAB: Checker for integer string Forms often allow a user to enter an integer. Write a program that takes in a string represe
Evgen [1.6K]

Answer:

Following are the program in the Python Programming Language:

def check(num): #define function

 if(num.isdigit()): #set if statement

   return "yes"; #return yes if condition is true

 else:  

   return "no";# return no if condition is false

string=input("Enter the numbers 0-9: ") #get input from the user

print(check(string)) #print and call the function

Output:

Enter the numbers 0-9: 1995

yes

Enter the numbers 0-9: 42,000

no

Explanation:

Here, we define a function "check()" and pass an argument in its parameter "num" inside the function.

  • we set if-else conditional statement and check the value stored in the variable "num" is the digit by using built in function "isdigit()" then return "yes".
  • Then, otherwise it return "no".

Finally, we get the input from the user in the variable "string" then, we call the function through "print()" function.

7 0
4 years ago
Write a c program to count the total number of commented characters and words in a c file taking both types of c file comments (
Tanzania [10]

#include<stdio.h>

#include<stdlib.h>

int comment1(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\n')

       {

           return count;

       }

       count++;

   }

   return count;

}

int comment2(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='*')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               return count;

           }

           count++;

       }

       count++;

   }

   return 0;

}

int main()

{

   printf("Enter the file name:");

   char s[1000],ch,ch1;

   scanf("%s",s);

   FILE*fp;

   fp = fopen(s,"r");

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\"')

       {

           while(fscanf(fp,"%c",&ch)!=EOF)

           {

               if(ch=='\"')

               {

                   break;

               }

               if(ch=='\\')

               {

                   fscanf(fp,"%c",&ch);

               }

           }

       }

       else if(ch=='/')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               count += comment1(fp);

           }

           else if(ch=='*')

           {

               count += comment2(fp);

           }

       }

   }

   printf("%d\n",count);

   return 0;    

}

3 0
3 years ago
Read 2 more answers
Differentiate between computer organization and computer architecture with example
vazorg [7]
<span><span>Computer architecture was essentially a contract with software stating unambiguously what the hardware does. The architecture was essentially a set of statements of the form "If you execute <span>this </span>instruction (or get an interrupt, etc.), then that is what happens." <More sophisticated readers: I get to the term "ISA" later.>
</span><span>Computer organization, then, was a usually high-level description of the logic, memory, etc., used to implement that contract: These registers, those data paths, this connection to memory, etc.

</span></span>Computer Architecture and Computer Organization Examples

<span>Intel and AMD make X86 CPUs where X86 refers to the computer architecture used. X86 is an example on a CISC architecture (CISC stands for Complex Instruction Set Computer). CISC instructions are complex and may take multiple CPU cycles to execute. As you can see, one architecture (X86) but two different computer organizations (Intel and AMD flavors).
<span>
nVidia and Qualcomm on the other hand make GPUs (graphics processing unit as opposed to a CPU central processing unit). These GPUs are based on the ARM (Advanced RISC Machines) architecture. ARM is an example on a RISC architecture (RISC stands for Reduced Instruction Set Computer). Instructions in an ARM architecture are relatively simple and typically execute in one clock cycle. Similarly, ARM here is the computer architecture while both nVidia and Qualcomm develop their own flavor of computer organization (i.e architecture implementation)</span></span>
8 0
4 years ago
4:when a computer is on it is
Tanzania [10]

Answer:

c: running

Explanation:

when the computer is turned on The operating system keeps things organized in the background so that multiple programs can run at the same time

4 0
2 years ago
Other questions:
  • A field that will always have a unique value is
    15·2 answers
  • How to delete a virus that act by restarting u r computer? I am in safe mood to aviod restart.
    10·1 answer
  • Negative methods of behavior correction include all but this:
    9·1 answer
  • Define a void function that calculates the sum (+), difference (-), product (*), quotient (/), and modulus (%) of two integer nu
    14·1 answer
  • The class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not c
    6·2 answers
  • One microsleep warning sign occurs when you catch yourself leaning blank in the drivers seat
    12·1 answer
  • Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T
    7·1 answer
  • An example of a _________________ impact is when a consumer wants to buy a product on the internet but is afraid the company won
    8·2 answers
  • USE THIS CODE ON FETCH REWARDS FOR BRAINLIEST​
    10·1 answer
  • Eşhedü en la ilahe illallah ve eşhedü enne Muhammeden abdühü ve resulühü
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!