Write an if-else statement for the following:
If user_tickets is less than 5, assign 1 to num_tickets. Else, assign user_tickets to num_tickets.

Answers

Answer 1

In python 3.8:

if user_tickets < 5:

   num_tickets = 1

else:

   num_tickets = user_tickets

For this code to work properly, you'll have to first declare user_tickets before the if-else statements.


Related Questions

What is the most vulnerable information that should be protected to prevent unauthorized access to your online files and records?

Answers

Answer:

Your user ID and password.

Explanation:

The user Id and password must be protected because when it is exposed to a third party then they can get access to information, data, to things they are not supposed to.

The user Id and password is provided as an authentication measure for one to be able to gain access to a computer system, network or files. It is what grants access to online files and record as it is the case here. It has to be protected for the sake of privacy.

A flashlight bulb uses 2.4 W of power when the current in the bulb is 0.8 A. What is the voltage difference?

Answers

Answer:

3 Volts.

Explanation:

Answer:

3 Volts

Explanation:

Because Power = Voltage x Current, so if you substitute the values into the equation, it would be :

2.4 W = Voltage x 0.8 A

Then if you rearrange the equation, it would be :

2.4 W / 0.8 A = Voltage

Which is :

3 V = Voltage

Supporting mobility and smartphone apps is important to MasterCard. What challenges does MasterCard face in rolling out smartphone payment systems? Which of these do you think will be most difficult to address? Why?

(BEWARE OF PLAGARISM, DO NOT JUST COPY PASTE FROM THE INTERNET)

Answers

Answer:

Throughout the clarification portion below, the definition of the concern is mentioned.

Explanation:

Security

The best characteristic that arrives in and out of mind when people think concerning mobile payments would be security. The greater problem for customers and suppliers is this. As mobile purchases are made, suppliers store card information for potential purchases. Anyway, several vendors note that the data would not be kept on either the service side, however people are rather fearful of sending details.

Technology

Some people seem to agree that there's been a significant change in technology in recent years. Especially if we get to see that the frequency of internet access also isn't up to standards in most countries. And in some countries, the network is unavailable and will not link.

Different mobile platforms

The very next thing that needs to be confronted seems to be the multiple platforms crisis. Mobile now has multiple systems and apps that a company produces towards one platform simply doesn't work on yet another platform. Platforms including Android exist.

Fewer users

That very many consumers are accustomed to the current payment service, such as currency, credit card, debit card, pockets including a few others. Because they do not believe them, they weren't in a condition to introduce a different payment system. This has become one of the smartphone transaction system's obstacles.

Required incentives

Incentives are offered whenever the purchase is done by cards or wallets, but they are not accessible when another payment has been made via the billing system for smartphones. To draw more customers, they can do good promotions.

Tedious circulate of payments and incoherent consumer experience

The payment water flowing through several iterations through both the smartphone financial services for compensation. Although if we take into account the payment movement of cards, it is very straightforward. Some manufacturers have now launched embedded chips that are safer than magnet circuits. The transaction seems to be much better on these chips, and performance is instantaneous and smooth.

If after a call to fork, we want any updates to memory by the parent process to be visible to the child process, and vice-versa, what flag should be included in the fourth argument of mmap?

Answers

Answer:

MAP_SHARED

Explanation:

The MAP_SHARED should be included in the 4th argument of map. When we have a MAP_SHARED set, then we have it that it is preserved across a fork2 system call.

It is visible immediately in every parent, siblings or child processes. This is to say that any change that is made to this mapping is immediately seen by readers.

Are Dogs are better than video games?

Answers

sometimes bc dogs are very lovey but video games also have there moments

Answer:

In some cases yes.

Explanation:

Some days I really enjoy my video games and other days I enjoy being with my dog but sometimes they are annoying especially if they have way more energy than you

Write a program that takes a positive integer argument N, and prints out the average, minimum, and maximum (in that order) of N uniform random numbers that it generates. Note that all three statistics should be over the same sequence of N random numbers python

Answers

Answer:

from random import seed, choices

from statistics import mean

number = int(input("Enter integer number: "))

if number > 0:

   try:

       data = range(number+1)

       # to generate a pseudo-random number list.

       seed(10)

       # you can also use: num_list = [random.randint(0, number+1) for i in data]

       num_list = choices(data, k=len(data))

       print(num_list)

       mean_val = round(mean(num_list), 2)

       min_val = min(num_list)

       max_val = max(num_list)

   except ValueError:

       print("Must be an integer value.")

print('Avg number: {}\nMax number: {}\nMin number: {}'.format(mean_val, max_val, min_val))

Explanation:

To generate random items in a list of integers, the random choices method is used and a sequence is passed as an argument. The average, maximum, and minimum number of the list is calculated and displayed.

A DVD-ROM can store more data than a CD-ROM of the same size. Comment.

Answers

Answer:

ya its true that DVD-ROM can store more data except CD-ROM

Explanation:

more dat saving in with DVD-ROM

When tracking time for subcontractors, which QuickBooks window is used to enter subcontractor information? Vendors List Payroll Setup Item List Employee List

Answers

Answer:

Vendors list

Explanation:

The answer to this question is the vendors list. The Vendor List can be defined as a selected or contracted list of suppliers that is needed for a project or company.

The vendor list a quickbooks window that is used to enter subcontractor information. Quickbooks definition of a vendor is a person from whom a product is purchased

Shelly recorded an audio composition for her presentation. Arrange the following steps that Shelly followed in the proper order.

She added effects to her audio composition.
She saved her audio composition on an optical drive.
She connected her microphone to her computer.
She saved the audio composition in an appropriate file format.
She selected the record option in her DAW.

Answers

Answer:

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

Explanation:

Shelly recorded an audio composition for her presentation. She needs to follow the following proper orders to get composition done for her presentation.

She connected her microphone to her computer.She selected the record option in her DAW.She added effects to her audio composition.She saved the audio composition in an appropriate file format.She saved her audio composition on an optical drive.

Answer:

She connected her microphone to her computer.

She selected the record option in her DAW.

She added effects to her audio composition.

She saved the audio composition in an appropriate file format.

She saved her audio composition on an optical drive.

Marly is using her smartphone to review a webpage she created. The formatting and alignment of webpage elements is incorrect. What does she need to change to fix the problem?

a. C++
b. HTML
c. JavaScript
d. CSS

Answers

Answer:

d

Explanation:

CSS is the element to design a webpage and make it look appeasing

c++ is a programming language that is not used in webpages (like Python)

JS makes interactive features

HTML is just the text

What is the benefit of encapsulation?

A. To rename variables
B. To reuse code
C. To make all members public
D. To make all members protected

Answers

Answer:

B. To reuse code

What is an example of an absolute cell reference? 52% D2 $B$5 !90!

Answers

Answer:

$B$5 is an example of absolute cell reference

Explanation:

There are two types of referencing in MS Excel.

1. Relative

2. Absolute

Relative cell referencing changes according to the corresponding new cells when it is copied in other cells. MS Excel uses relative cell referencing by default.

Absolute cell referencing uses dollar sign with the row number and column name. When any formula with absolute referencing is copied, the cell addresses used remain the same.

From the given choices in question,

$B$5 is an example of absolute cell reference

An example of an absolute cell reference is "$B$5".

Thus, option (C) is correct.

Cell references can be either relative or absolute.

A relative cell reference changes when it is copied to another cell.

For example, if you have a formula in cell C2 that references cell A2 as "=A2+1", and you copy this formula to cell C3, it will automatically adjust to "=A3+1".

An absolute cell reference remains constant, regardless of where it is copied. When a cell reference is made absolute, the dollar sign ($) is used to indicate this.

For example, if you have a formula in cell C2 that references cell B5 as "=B$5+1", and you copy this formula to cell D3, it will still refer to cell B5 as "=B$5+1". The row and column references remain fixed.

Therefore, "$B$5" is an absolute cell reference.

Thus, option (C) is correct.

Learn more about Cell Reference here:

https://brainly.com/question/30714866

#SPJ6

Write a program that passes an unspecified number of integers from command line and displays their total.

Answers

Answer:

Explanation:

I will go straight to the code, and hope it didn't confuse you.

Here is it

public static void main(String[] args)

int [] x = new int [args.length]

for (int y = 0; y< args.length;yi++)

int[y] = (int) args [y]

Select the items that can be measured.
capacity
smoothness
nationality
thickness
distance
scent
income

Answers

Answer:

distance

capacity

smoothness

thickness

capacity, smoothness, thickness, distance, income

Using pointers and shared memory for IPC, what would you need to add to your code to ensure data integrity?
Explain how commit works in a multi-transaction / multi-system function and what would need to be in place for a rollback to be successful.
Explain how buffering of data achieves a more efficient way to do I/O. Why is it important to add buffering to I/O?
What is the difference between blocking calls and non-blocking calls? Explain 2 methods to remove blocking from your application.

Answers

Answer:

integrgrg

Explanation:

integrety or not iim not

Non-blocking code does not prevent execution from continuing while blocking code prevents execution from continuing until the operation is complete. Blocking calls hold off on returning until the I/O operation is finished. Synchronous results are returned from it.

What is the difference between blocking calls and non-blocking calls?

Blocking calls hold off on returning until the I/O operation is finished. Synchronous results are returned from it. During the waiting period, nothing else in that process happens. In contrast, a non-blocking call uses a different method to check for completion and returns right away without any results.

Non-blocking code does not prevent execution from continuing while blocking code prevents execution from continuing until the operation is complete. Blocking occurs when subsequent JavaScript in the Node. js process needs to wait until a non-JavaScript activity is finished, according to the documentation for the language.

A program that is non-blocking does not prevent the execution of subsequent operations. Non-blocking techniques run in an asynchronous fashion. Asynchronously refers to the possibility that the program may not always run line by line.

To learn more about blocking and non-blocking calls refer to:

https://brainly.com/question/14286067

#SPJ2

A2 Suggest why the Petri dish and agar jelly needed to be sterile.​

Answers

A Petri dish (Petri plate) is a shallow cylindrical glass lidded dish that is typically used to culture microorganisms (agar plates). There are glass and plastic Petri dishes, and both can be sterilized (using an autoclave) and re-used. Before being used for culture purposes, it is important to ensure that the Petri dish is not only clean, but also sterile. This helps prevent the contamination of the new culture.Agar is a polymer made up of various sub-units of galactose and various species of red algae. Although it has other uses including culinary and dentistry, agar plays an important role in microbiology as culture media for a variety of microorganisms.As compared to some of the other alternatives like gelatin, agar has a number of advantages which include:Cannot be easily degraded by microorganism Stronger Firmer than gelatin

Which software programs should students avoid using to create and submit course work? (Choose all that apply). Word, Pages, Numbers, Keynote

Answers

Answer:

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

Explanation:

You can submit your course work most often in a Word document. Because in the word document, you can insert text, numbers, images, charts whatever you want such as required for writing a book- easily.

The correct options to this question, that you should need to avoid using to create and submit course work are pages, numbers, and keynote.

Because while submitting the course work, you need to submit a complete word document, it is not required to you that you have to submit numbers, pages, or keynotes along with the course assignment. You can create a course assignment or project document in word and submit to your respective teacher. However, you can not create your course work using keynotes or pages, etc as given in the question.

What are some applications of a Router?

Answers

Applications of Routers. Routers are the building blocks of Telecom service providers. They are used for connecting core hardware equipment such as MGW, BSC, SGSN, IN and other servers to remote location network. Thus work as a backbone of Mobile operations.

what program we write for nested if in c++ to print something after else part but before inner if else
if(condition){
}
else
//something we want to print
if(condition){
}
else{
}

Answers

Answer:

if(condition){

}

else  {

  // something we want to print

  if(condition) {

     // ...

  }

  else {

     // ...

  }

}

Explanation:

Create code blocks using curly braces { ... }.

Use proper indentation to visibly make it clear where code blocks start and end.

________ group is used to select font styles. ​

Answers

Answer:

The font group............. ...

What special responsibilities do computer professionals have with respect to understanding and protecting the privacy rights of their fellow citizens?

Answers

Explanation:

There are ethical responsibilities that must be linked to the use of technological systems by computer professionals in relation to the protection of the privacy rights of their fellow citizens.

Exercising ethical behavior is essential for computing to be used for its central benefits, which is to make life and tasks simpler and more dynamic, and not for technical knowledge about computer science to be used for personal or other benefits. , therefore, it is ideal that there is ethical responsibility for computer professionals so that ethical decisions are taken so that knowledge is used for the benefit of society and not to commit illegal acts.

Assume there is a 30-byte heap. The free list for this heap has two elements on it. One entry describes the first 10-byte free segment (bytes 0-9), and one entry describes the other free segment (bytes 20-29). Now assume we have a request for just a single byte of memory. In this case, the allocator will perform an action known as________ to find a free chunk of memory that can satisfy the request.

a. splitting
b. coalescing
c. chopping
d. relocating

Answers

Answer:

The answer is "Option a".

Explanation:

It is a psychological system that enables its individual to accept difficult or overwhelming feelings and see somebody positive or negative, desirable, or depreciated. It complicates, its control of emotions, which sounds inconsistent mostly on the surface. It also simplifies its control of feelings, which appear conflicting mostly on the surface.

answer the 1 question for 10 points plz dont get it wrong. HAVE A GREAT DAY

Answers

Answer:

3rd one

Explanation:

discuss data and its types from computer programming and data analysis prospectively?​

Answers

Answer:

With the use of data and their types the extent of how much data can be stored can get insanely large. types like doubles and longs allow for a range of values nearly incomprehensible in their size for storing user information, web pages, games ect. Using them essentially allows you to plan for the future of the size of whatever you're creating. On top of that, it allows for a preciseness not typically able to be reached without these types.

Raw information that is made up of simple facts and figures is referred to as data. Computer data can take many different forms, including financial data, notes, photographs, and coding.

What is data?

The amount of data that may be kept can become absurdly vast depending on how it is used and the categories of data. For storing user information, web pages, games, etc., types like doubles and longs provide for a range of values almost incomprehensible in their vastness.

Utilizing them effectively enables you to plan for the magnitude of whatever you're developing in the future. Additionally, it enables a level of precision that is often not possible without these types.

Therefore, raw information that is made up of simple facts and figures is referred to as data. Computer data can take many different forms, including financial data, notes, photographs, and coding.

To learn more about data, refer to the link:

https://brainly.com/question/10980404

#SPJ5

Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive).

Answers

In python:

if 8 < user_grade < 13:

   print("in high school")

You would just need to supply the value of the user_grade variable.

Let g(x) = cos(x/2) - 3x. Let f(x) = 2x + 5. What is g(f(x))?​

Answers

Answer:

f = 2

Explanation:

g(x) = cos(x/2) - 3x=w where w=-3.5 or -1 or -38.5

13– (13/2)-3*13=-3.5 (1st d value of g(x))

-1-(-1/2)-3*(-1)=-1 (the 2nd possible value)

g(x) = cos(x/2) - 3x=-1 where the first x=13 and the 2nd one=-1

where the first x=-1 and the 2nd one=-38.5 (the 3rd value)

g(x) = cos(x/2) - 3x)=0 where cos(x/2=-3.5

g(f(x)) = cos(f(x)/2) - 3 aka 0.5 f(x) = cos(2x+5 aka 7x) (x/2 - 3 =aka -1 );

(2x+5) = 7x by definition but the equation has to be set to 7 to find x)

(7x/2 -6x=0) -7 on both sides

x/2–6x=-7

x/2= 13

26/2=x

x=13 (these values are set up for 2x+5=7.

13-(-7)=-7

13-6+-1=-7

the 2nd x=-1

gfx=cos*2*x i.e cos*2*13 or cos*2*-1

cos*2*13=26

cos*2*(-1)=-1

cos=1

(cos*2*13)=the 1st gfx value=26 basically.

( cos*2*(-13)=-26 (the 2nd gfx value)

cos*2*(-1)=-`1 (the 3rd gfx value)

f=2

hope this helped!

A network the size of the Internet requires DNS services in order to function. Discuss the advantages and disadvantages of implementing DNS relative to the size of the network.

Answers

Answer:

Advantages

Host Naming  : For DNS Implementation there is no need to create and maintain a local names configuration file also there is no need to understand complex Oracle Names administration procedures and this because the name of the host is sufficient enough for one to establish a connectionLocal Naming : It's relative easier to resolve service name addresses and also across different protocols

Disadvantages

Host Naming  : The disadvantage is that your client and the server connects making use of TCIP/IPLocal Naming : The disadvantage as regards to local naming is that it will require the local configuration of all service and address name changes to carry out local naming

Explanation:

Advantages

Host Naming  : For DNS Implementation there is no need to create and maintain a local names configuration file also there is no need to understand complex Oracle Names administration procedures and this because the name of the host is sufficient enough for one to establish a connectionLocal Naming : It's relative easier to resolve service name addresses and also across different protocols

Disadvantages

Host Naming  : The disadvantage is that your client and the server connects making use of TCIP/IPLocal Naming : The disadvantage as regards to local naming is that it will require the local configuration of all service and address name changes to carry out local naming

principle of rocket propulsion is based on _​

Answers

Answer: Newton’s third law of motion
Explanation: The propulsion of all rockets, jet engines, deflating balloons, and even squids and octopuses is explained by the same physical principle—Newton's third law of motion.

Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75). You should use input to read a string and float() to convert the string to a number. Do not worry about error checking the user input - assume the user types numbers properly.​

Answers

I've included my code in the picture below. Best of luck.

What was that show where lowe’s were based off eye colors and the main character had orange eyes that let her mind control people. It was either on netflix or hulu

Answers

The Innocents on Hulu i think

Answer:Raising Dion?

Explanation:

Was it Raising Dion?

Other Questions
answer pleasee alll lowkey failing math Choose the word that best describes the distance between two points.A. averageB. lengthC. midpointD. slope PLEASE PROVIDE AN EXPLANATION.THANKS!!! 10. A golf ball is propelled with an initial velocity of 60meters per second at 37 above the horizontal. Thehorizontal component of the golf ball's initial veloc-ity is What role did Thomas Lynch, Jr., Thomas Heyward, Jr., Edward Rutledge, and Arthur Middleton have as part of the Second Continental Congress?They boycotted the Congress and refused to participate unless South Carolina was given more delegates.They encouraged the Congress to take action to help South Carolinians in the Upcountry.They served as delegates to the Congress and signed the Declaration of Independence.O They argued against independence and refused to sign the Declaration of Independence. The value of r in this system of equations is 1. 3r+y=9 y=4r + 10 1. Subsmute the value of y in the first equation 2. Combine Ike terms 3t+r+ 10) = 9 -I = 10=9 -=-1 3. Apply the subtraction property of equality - Apply the division property of equality What is the value of y what are the two sects of Islam and what do they disagree on Which sentence best retells the passage? A. Some people do not care about their community and throw trash on the ground. B. Trash is harmful to people and animals and makes a neighborhood look bad. C. You can help your neighborhood look better and help the environment by picking up trash when on a walk. D. Everyone should start walking and picking up trash around their neighborhoods and community. Choose the correct way to complete the sentences to explain how to draw concentric circles when doing a freehand sketch.To use your hand as a temporary compass, you must grip the pencil using the . You can draw the arc or circle by . If you are riding your bike west to your friends house, and you ride the 1.25 miles in 5 minutes, what is your velocity, in miles per hour? who is imprisoned in the labyrinth ? 10. What would be an agricultural disadvantage to having a planting soil with high permeability? Can CBD product be harmful give me more than three reasons that you hate trump (other that he's racists )give evidence How do you increase the amount of electrical energy produced from running water? Why is Mg++ smaller than Mg atom? what the capital of Australia Why do some wolves sleep away from the pack? A. They dont like the pack B. They are outcasts C. The den is too crowded D. Both B and C Complete ?:44=2:11(Please help me ) PLEASEE ANSWER RIGHT THIS IS A EXIT TICKET :(