6. What is printed by the following when executes? 1 str= "His shirt is red" 2 pos= str.find("is") 3 print (pos) A. 9 B. 2 C. pos D. 1 7. What is the value of s1 after the following code executes? s1= "heY" 1 2 81-> s1.capitalize() ss1.lower () A. heY B. Hey C. hey D. HEY 8. Which line of code correctly gets the value of the key 'apples' if it exists and returns 0 if it does not? fruits = {'bananas': 7, 'apples': 4, 'grapes': 19, 'pears': 4) A. fruits.get(apples) B. fruits.get(apples,0) C. fruits.get('apple') D. fruits.get('apples',0) 9. What is printed by the following statements? 8 = "ball" 1 for item in s: r = item.upper () + r print (r) A. Ball B. BALL C. LLAB D. TypeError 10. Which type of loop can be used to perform the following iteration: You choose a positive intege random and then print the numbers from 1 up to and including the selected integer. A. Only FOR-loop B. Only WHILE-loop C. FOR and/or WHILE loops D. NONE 11. What will the following code print? for i in range (1,4): for j in range (1,4): print (i, j, end=> >) 2 4
Operations
In mathematics and computer science, an operation is an event that is carried out to satisfy a given task. Basic operations of a computer system are input, processing, output, storage, and control.
Basic Operators
An operator is a symbol that indicates an operation to be performed. We are familiar with operators in mathematics; operators used in computer programming are—in many ways—similar to mathematical operators.
Division Operator
We all learnt about division—and the division operator—in school. You probably know of both these symbols as representing division:
Modulus Operator
Modulus can be represented either as (mod or modulo) in computing operation. Modulus comes under arithmetic operations. Any number or variable which produces absolute value is modulus functionality. Magnitude of any function is totally changed by modulo operator as it changes even negative value to positive.
Operators
In the realm of programming, operators refer to the symbols that perform some function. They are tasked with instructing the compiler on the type of action that needs to be performed on the values passed as operands. Operators can be used in mathematical formulas and equations. In programming languages like Python, C, and Java, a variety of operators are defined.
python, pleaseeee
Step by step
Solved in 3 steps