28 solutions available
Question 16Which of the following four code fragments will yield following output?Eina Mina Dika Select all of the function calls that result in...
Question 2How are keywords different from identifiers?
Question 17Describe the concepts of block and body. What is indentation and how is it related to block and body?
Question 20What are immutable and mutable types? List immutable and mutable types of Python.
Question 21What is the difference between implicit type conversion and explicit type conversion?
Question 22An immutable data type is one that cannot change after being created. Give three reasons to use immutable data.
Question 23What is entry controlled loop? Which loop is entry controlled loop in Python?
Question 24Explain the use of the pass statement. Illustrate it with an example.
Question 25Rewrite the adjacent code in python after removing all syntax error(s). Underline each correction done in the code.30 = To for K in...
Question 26Below are seven segments of code, each with a part coloured. Indicate the data type of each coloured part by choosing the correct type of...
Question 27Write the output of the following Python code:for i in range(2,7,2): print(i*'$')
Question 1Fill in the missing lines of code in the following code. The code reads in a limit amount and a list of prices and prints the largest price...
Question 2bPredict the output of the following code fragments:x = 10 y = 0 while x > y: print (x, y) x = x - 1 y = y + 1
Question 2cPredict the output of the following code fragments:keepgoing = True x=100 while keepgoing : print...
Question 2ePredict the output of the following code fragments:for x in [1,2,3,4,5]: print (x)
Question 2fPredict the output of the following code fragments:for p in range(1,10): print (p)
Question 2gPredict the output of the following code fragments:for z in range(-500, 500, 100): print (z)
Question 2hPredict the output of the following code fragments:x = 10 y = 5 for i in range(x-y * 2):...
Question 2iPredict the output of the following code fragments:c = 0 for x in range(10): for y in range(5): c += 1 print (c)
Question 2kPredict the output of the following code fragments:for x in 'lamp': print(str.upper(x))
Question 2lPredict the output of the following code fragments:x = 'one' y = 'two' counter = 0 while counter...
Question 2mPredict the output of the following code fragments:x = "apple, pear, peach" y = x.split(", ") for z in y : print(z)
Question 2nPredict the output of the following code fragments:x ='apple, pear, peach, grapefruit' y = x.split(', ') for z in y: if z < 'm':...
Question 4(ii)How many times will the following for loop execute and what's the output?for i in range(1,3,1): for j in range(i+1):...
Question 5Find and write the output of the following python code:for Name in ['Jay', 'Riya', 'Tanu', 'Anil'] : print (Name) if Name[0] == 'T'...
Question 6Is the loop in the code below infinite? How do you know (for sure) before you run it?m = 3 n = 5 while n < 10: m = n - 1 n = 2 *...
Question 5Write a program that asks the user the day number in a year in the range 2 to 365 and asks the first day of the year — Sunday or Monday or...
Question 11Write a program that reads two times in military format (0900, 1730) and prints the number of hours and minutes between the two times.A...