Sunday, May 9, 2021

Write A Conditional That Decreases The Variable ShelfLife

Write an expression that evaluates to true if and only if the integer x is greater than the integer y. x>y. Write an expression that evaluates to true if and only if the value of the integer variable x is equal to zero. Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater thanWrite a conditional that assigns 10,000 to bonus if the goods_sold is greater than 500,000. if goods_sold > 500000: bonus=10000 10. The value assigned to a global constant can be changed in the mainline logic.Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000 .2.Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000 . 3 Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the int variables neutral , base , and acid : 0, 0, 1 if pH is less than 7 0, 1, 0 if pH is greater than 71. Write a conditional that assigns true ( 1 ) to the variable fever if the variable temperature is greater than 98.6 . 2.Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000 . 3 Write an if/else statement that compares the double variable p

Python Online Quiz Questions Answers 4 - Kodlogs

View CMSC140_ClassWorksheet8_if-else Answers.docx from AA 1Montgomery College CMSC 140, Class Worksheet 8 Objectives - Conditional statements Questions 1.What does the following code fragment writeAssessment 2 - Chapter 3 1. Write a conditional that assigns 10,000 to the variabe bonus if the value of the variable goodsSold is greater than 500,000. 2. Write an if/else statement that compares the variable age with 65, adds 1 to the variable seniorCitizens if age is greater than or equal to 65, and adds 1 to the variable nonSeniors otherwise. 3.Write a conditional that assigns the boolean value true to the variable fever if the variable temperature is greater than 98.6. Example: So if temperature has the value 99.5, after your code executes fever would have the value true.Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000. June 3, 2017 Matthew Maennche Learn To Code , Visual Basic 40361 , Visual Basic

Python Online Quiz Questions Answers 4 - Kodlogs

Solved: Write A Conditional That Assigns 10,000 To The Var

40360: Write a conditional that assigns true to the variable fever is the variable termperature is greater than 98.6. If (temperature > 98.6) Then fever = true End If 40361: Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000. If (goodsSold > 500000) Then bonus = 10000 End IfWrite a conditional that assigns 10,000 to bonus if the goods_sold is greater than 500,000. Write a conditional that decreases the value associated with shelf_life by 4 if the value associated with outside_temperature is greater than 90.Write a conditional that assigns 10,000 to bonus if the goods_sold is greater than 500,000 if goods_sold > 500000 bonus = 10000 Write a conditional that decreases the value associated with shelf_life by 4 if the value associated with outside_temperature is greater than 90.Question: Write a conditional that assigns 10,000 to bonus if the goods_sold is greater than 500,000. Answer: if goods_sold > 500000: bonus=10000 . Question: The first line in the function definition is known as the function _____. Answer: Header Question: What is the set of rules for forming sentences in a language called? Answer: SyntaxWrite a statement that adds 1 to the variable reverseDrivers if the variable speed is less than 0,adds 1 to the variable parkedDrivers if the variable speed is less than 1,adds 1 to the variable slowDrivers if the variable speed is less than 40,adds 1 to the variable safeDrivers if the variable speed is less than or equal to 65, and otherwise

1. Write an if observation that assigns 20 to the variable y and assigns 40 to the variable z if the variable x is greater than 100.

if x > 100: y = 20 z = 40

2. True/False: Different functions can have native variables with the similar names.

TRUE

3. The not operator is a unary operator and it will have to be a compound expression.

FALSE

4. True/False: Python allows for passing multiple arguments to a serve as.

TRUE

5. In Python you cannot write purposes that settle for multiple arguments.

F

6. What Python function would you use if you wanted to instructed the user for a file name to open?

enter( )

7. Which means would you employ to get all the parts in a dictionary returned as a checklist of tuples?

pieces

8. Which would you use to get the selection of parts in a dictionary?

len

9. Write a conditional that assigns 10,000 to bonus if the goods_sold is greater than 500,000.

if goods_sold > 500000: bonus=10000

10. The price assigned to a global consistent may also be modified in the mainline good judgment. T/F

FALSE

11. This operator determines whether or not one string is contained inside of some other string.

in

12. Python comes with ________ purposes that have already been prewritten for the programmer.

Library

13. What is the algorithm for forming sentences in a language known as? Pragmatics Semantics Syntax Logic

Syntax

14. What is the general selection of distinct values in the ASCII set?

256

15. Which way can be utilized to convert a tuple to a checklist?

List

16. What is the choice of the first index in a dictionary?

Dictionaries are not listed by means of quantity.

17. Python lets in you to cross multiple arguments to a serve as.

TRUE

18. True/False: IN PYTHON, there is no restriction on the name of a module report.

TRUE

19. Write a observation that reads a word from same old input into firstWord.

enter()

20. Given the collection of rows and the selection of columns, write nested loops to print a rectangle. Sample output with inputs: 2 3 * * * * * *

for i in range(num_rows): for j in vary(num_cols): print('*', end=' ')

21. Python permits the programmer to paintings with textual content and quantity files.

FALSE

22. In Python, the __________ serve as is used to enter knowledge inside an array.

append

23. What form of loop structure repeats the code a specific collection of times?

count-controlled loop

24. Given the architecture and terminology we presented in Chapter 1, where are files stored?

Secondary memory

25. A function definition specifies what a function does and causes the serve as to execute. T/F

FALSE

26. What Python function would you use if you wanted to urged the person for a record identify to open?

input( )

27. This will happen if you take a look at to use an index that is out of vary for a string. a. A ValueError exception will occur. b. An IndexError exception will occur. c. The string will likely be erased and the program will proceed to run. d. Nothing-the invalid index will probably be omitted.

An IndexError exception will occur.

28. Python comes with ________ purposes that have already been prewritten for the programmer.

Standard

29. What is the algorithm for forming sentences in a language known as? a Semantics b Pragmatics c Syntax d Logic

D. good judgment

30. What is the collection of the first index in a dictionary?

Dictionaries aren't listed by way of quantity

31. The __________ design technique can be used to smash down an algorithm into functions.

Top-Down

32. Given a String variable deal with, write a String expression consisting of the string "http://" concatenated with the variable's String value. So, if the variable refers to "www.turingscraft.com", the worth of the expression would be "http://www.turingscraft.com".

"http://"+address

33. Which mode specifier will open a document however no longer assist you to change the record or write to it?

'r'

34. A programmer typically starts by means of writing high-level language statements in a textual content editor.

T

35. True/False: A mutator means has no regulate over the method that a magnificence's knowledge attributes are modified.

FALSE

36. When using the range serve as, what effect does the specification of a third argument have?

The third argument specifies a step value to be utilized in the range

37. What is the maximum not unusual Unicode encoding when transferring information between methods?

UTF-8

38. A USB reminiscence stick is an example of which of the following elements of laptop architecture?

Secondary Memory

39. Which of the following lists of operators is ordered through reducing priority? -, //, ** *, /, % +, *, ** **, *, +

**, *, +

40. What is the first step to take in order to practice a recursive way?

establish at least one case through which the problem can be solved without recursion

41. In a mixed-type expression involving ints and floats, Python will convert

ints to floats

42. Unfortunately, there is no approach to store and phone on purposes when using turtle graphics. A. True B. False

FALSE

43. What can be displayed after the following code is completed? total = 0 for count in range(1,4): general += rely print(general)

6

44. What will likely be displayed after the following code is achieved? general = Zero for count in range(4,6): general += count print(general)

Four 9

45. What can be displayed after the following code is executed? rely = Four while depend < 12: print("counting") rely = count + 2

counting counting counting counting

46. What will probably be displayed after the following code is finished? for num in vary(0, 20, 5): num += num print(num)

30

47. True/False: A function definition specifies what a function does and causes the serve as to execute.

FALSE

48. What is the return worth of the string manner lstrip()

The string with all leading whitespaces removed.

49. Which of the following names in a program is an identical to the name int?

Int INT All of the above (None of the above) . solution

50. Computer languages designed to be used and understood through humans are

high-level laptop languages

51. What statement correctly describes the use of a parameter in Python?

The title used in the serve as definition for an argument that is handed to the serve as when it's called.

52. The ________ of a local variable is the function through which that variable is created.

scope

53. Which of the following operators is used to invert a conditional remark? A or B and C not D equal

C

54. The contents of this kind of report may also be considered in an editor akin to Notepad.

Text document

55. A ________ variable is created within a function.

native

56. What is the maximum commonplace Unicode encoding when shifting knowledge between methods?

UTF-8

57. Python does now not have GUI programming options constructed into the language itself.

TRUE

58. The price assigned to a global consistent will also be changed in the mainline logic. T/F

FALSE

59. In a mixed-type expression involving ints and floats, Python will convert

ints to floats

60. What statement appropriately describes the use of a parameter in Python?

A parameter is the identify used in the function definition for an issue that is handed to the serve as when it is referred to as.

61. True or False: The first line in a whilst loop is referred to as the condition clause.

FALSE

62. The function header marks the beginning of the serve as definition. T/F

TRUE

63. What statement accurately describes the use of a parameter in Python?

A parameter is the title used in the function definition for an issue that is passed to the serve as when it is called

64. Write an expression that continues to bid till the person enters 'n'. Sample output with inputs: 'y' 'y' 'n' I'll bid ! Continue bidding? I'll bid ! Continue bidding? I'll bid ! Continue bidding?

(keep_going!='n')

65. Given a string, return a string the place for every char in the unique, there are two chars. double_char('The') → 'TThhee' double_char('AAbb') → 'AAAAbbbb' double_char('Hi-There') → 'HHii--TThheerree'

def double_char(str): result = '' for char in str: end result += char * 2 go back result

66. The determination structure that has two conceivable paths of execution is known as _____.

Dual Alternative

67. What type of loop structure repeats the code a explicit choice of times?

count-controlled loop

If you found any kind of mistake, like improper answers or the rest syntactical, Please let us know. It will lend a hand us in bettering content material for you guys.

Chapter 3-Lab Questions And Answers.docx - Chapter-3 Write

Chapter 3-Lab Questions And Answers.docx - Chapter-3 Write

0 comments:

Post a Comment

Popular Posts

Blog Archive