Question 22:
price = int(price)
Explanation: Because int() is an existing function to change the string to integer
Question 23:
DAT.to_excel('Listing.xlsx')
--------------------------------------
Hit the thumbs up if you are fine with the answer. Happy
Learning!
Question 22 CLO1: Consider the following line of code: price= input(Please enter the price: ") What...
+ Run C Code IMPORTANT: • Run the following code cell to create the input file, biostats.csv, which you will be using later. 74, In [ ]: N %%file biostats.csv Name, Sex, Age, Alex, M, 41, Bert, M, 42, Dave, M, 39, Elly, F, 30, Fran, F, 33, Jake, M, F, Luke, M, 34, F Myra, M, M, 38, Ruth, F, 28, 22 22 323 47 47, Height, Weight 170 200 167 70 115 143 139 280 98 75, 350...
(in python please) What is printed by the following program? Suppose the input is: Miller 34 62.5 CONVERSION = 3.5 TEMP = 23 name = input('Enter last name:') id = input('Enter a two digit integer: ') num = (int(id) * TEMP) % CONVERSION decNum = input('Enter a decimal number: ') mysteryNum = float(decNum) / CONVERSION - TEMP print('Name: ' + name) print('Id: ' + id) print('Mystery number: ' + str(mysteryNum)) Note: There are 3 lines of printed information; enter the...
Question 1 The code used to output messages to the screen begins with run # print output Flag this Question Question 2 The code used to begin a comment in the Python program source code is # Hello * Comment Flag this Question Question 3 A variable name is like a(n) input typed on a keyboard address in computer memory where values can be stored output to a computer screen value assigned to an address in computer memory Flag this...
40pts) Given the following code segment. mSwer= input("Enter age: ") ile answer != 'q' : try: print(int(answer) ) answer input ( " Enter age: ") except Value E rror : print ("Invalid answer 'q' age") Show what is printed if the user enters the following values at the prompt, one at a time. Print output User input 20 17 2a => 29 q 9. The following main function works with a class called Student that you will write. def main()...
Please, explain clearly each line of code with your answers. Question 1 Consider the following code snippet: int ctr = 0; int myarray[3]; for (int i = 0; i < 3; i++) { myarray[i] = ctr; ctr = ctr + i; } cout << myarray[2]; What is the output of the code snippet? Question 2 Consider the following code snippet: int cnt = 0; int numarray[2][3]; for (int i = 0; i < 3; i++) { for (int j =...
Question 31 CLO4: What will be the result of the following Python code when it is applied on the data frame given below salesDatagroupbyrEmirates"X"TotaLSales -sum 0 Emirates Total Sales 2014150000 Abu Dhabl H20202Nizar Dubal 2014 145000 H30303Abdulla Abu Dhabi 20142 200000 H40404 f Mohammed Dubai 2014 120000 Mohammed Abu Dhabi 015 90000 H20202 Nizar Dubal 015120000 H30303Abdulla Abu Dhabl 2015 170000 H40404Arif Mohammed Dubai 110000 H10101 Abu Dhab 2016220000 H20202 Nizar Dubai 2016 195000 ИЗ0303 Abdulla Abu Dhabi H40404Arif Mohammed...
Python Programming QUESTION 16 Which of the following is an example of a Keyword in Python? elif class for All of the above QUESTION 17 Which of the following is not an acceptable variable name in Python? 2ndVar $amount Rich& ard None of the above are acceptable variable names QUESTION 18 The number 1 rule in creating programs is ___________________- Write the code first Think before you program Let the compiler find you syntax errors There are no rules just...
Question 116 pts (TCO 2) What is the output of the following code? void func(int x) { x = x * 2; } int main( ) { int x = 10; func(x); cout << x << endl; } 20 30 10 5 Question 126 pts (TCO 2) A derived class is typically an example of _____. a “has a” relationship an “is a” relationship a “uses a” relationship an “is used” relationship Question...
JAVA MCQ QUESTION
WHAT IS THE ANSWER AND WHY
22. Consider the following code: public class C public int myVar; public void outerMethod) int myVar--1 Something x- new SomethingO public void myMethod O How do you write values to the instance variable myVar from inside myMethod? A. this.myVar - B. myVar. C. super.myVar D. C.this.myVar E. super ) .myVar
IT PYTHON
QUESTION1 Consider the following Python code, where infile.txt and outfile.txt both exist in the current directory 'z' ) 。1d = open ( ' infile. txt ' , for line in old: new.write (line) new.write') ne«.close () old.close) Which of the following options best describes the purpose or outcome of this code? O A copy of the file infile.txt is made (except in double line spacing) and saved as outfile.txt in the current directory. O A copy of the...