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

Can anyone please help with this programming code in python num= 7 if num > 3: print(“3”) if num < 5: print(“5”) if num ==

7: print(“7”) and please explain step by step cause I’m confuse
Computers and Technology
1 answer:
Andrei [34K]3 years ago
7 0

Answer:

The program will print out:

3

7

Explanation:

Let's replace "num" with what this variable is defined to in all of you if statements.

<u>First if statement:</u>

if 7 > 3:

 print("3")

Result: 7 is indeed greater then 3, so it will print "3"

<u>Second if statement:</u>

if 7 < 5:

 print("5")

Result: 7 is not less than 5, so it will not print "5"

<u>Third if statement:</u>

if 7 == 7:

  print("7")

Result: 7 is equal to 7, so it will print "7"

You might be interested in
To add text to a blank slide layout, _____.
Basile [38]
B, draw the text box
3 0
3 years ago
Write the following program in C++ to print:
Alenkinab [10]
1.
#include <iostream>#include <string>
using namespace std;
int main(){    string chars; // This is where we will put our @ signs and print them    for(int x=0;x < 5; x++){
        chars = chars + '@'; // This will concatenate an @ sign at the end of the variable        cout << chars << "\n";    }}

2.
#include <iostream>#include <string>
using namespace std;
int main(){    string name; // Our variable to store the name    cout << "What is your name? \n"; // Asks the user for their name    cin >> name;    cout << "\nWell, hello " << name << "!";}

3.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n"; // Asks for a number    cin >> number;    cout << "You entered " << number << "%!";}

4.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n";    cin >> number;
    int check = number % 2; // The modulo operator (the percent sign) gets the remainder of the quotient    if (check == 0) {        cout << number << " is even!"; // If the remainder is 0 then it prints out "x is even"    } else {        cout << number << " is odd!"; // If the remainder is not 0 then it prints out "x is odd"    }}

5.
#include <iostream>#include <string>
using namespace std;
int main(){    float r; // Our variable    cout << "Enter a radius\n";    cin >> r;    if (r < 0){        cout << "Lol. No."; // If the radius is less than zero print out that message    }    float circumference=2*3.14*r;    float area=r*r*3.14;    cout << "\n\n Circumference of circle: " << circumference;    cout << "\n Area of circle: " << area;}
4 0
3 years ago
Please help me with these short questions &gt;..
Thepotemich [5.8K]

Answer:

bmjcmbbobnkpkkjkbk

Explanation:

vuvkopbbkvkhovjlplbkp

6 0
2 years ago
Is the movie IT really that scary ? Rate between 1-10, 10 being I had nightmares
mezya [45]
5 I don’t think it’s good. I thought it was boring.
4 0
3 years ago
Which command is used to format a partition on a hard disk drive with the ext4 filesystem?
FinnZ [79.3K]
Mkfs -t ext4 /dev/file
5 0
3 years ago
Other questions:
  • Jerry suspects that information about his internet usage was sent to external websites without his knowledge. He is wary about t
    7·1 answer
  • [PROGRAMMING] A ____ signal indicates that a specific amount of time should pass before an action starts.
    13·1 answer
  • Meaning of page break​
    8·1 answer
  • When typing an outline, you can move a point from a lower level to a higher level by changing the list level from the outline me
    5·1 answer
  • Toby has lost valuable data on his computer a number of times due to system crashes caused by viruses. He decides to invest in a
    13·1 answer
  • How do i work on code with someone else? i use visual studio code. me and a friend wanna make a game together with code. how do
    8·1 answer
  • How do I keep my computer and data safe and secure while using the Internet?
    14·2 answers
  • Write a program named as reverse.c that reads a message, then prints the reversal of the message. The output of the program shou
    7·1 answer
  • Please help me I don't understand. It's Python.
    5·2 answers
  • Question 1
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!