1) Which expression evaluates to 4? a) 7/2*3 b) 7%2+3 c) 7//2-3 d) 7-2*3 2) In which of the following cases we will get <class 'int'> as output? a) x=47.0 print(type(x)) b) x=2**2**2 print(type(x)) c) x=10+20j print(type(x)) d) x='47' print(type(x)) 3) The XYZ Company has hired you as an intern on the coding team that creates an e-commerce application. You must write a script that asks the user for a value. The value must be used as a whole number in a calculation, even if the user enters a decimal value. Which of the following meets this requirement? a) total_items=float(input('How many items you required?')) b) total_items=str(input('How many items you required?')) c) total_items=int(float(input('How many items you required?'))) d) total_items=input('How many items you required?') 4) Which of the following statements are valid? a) The following expression evaluates to 12 b=False+5-True+35//4 b) The following line will print result:4.5 print('result:',(7/2)+(False or True)+(9%3)) c) result=456+456.0 type of result is int d) s="Siri's voice recognition is Good" It causes an error because we cannot use double quotes and single quotes simultaneously 5) Which expression would evaluate to 2? a) 11/2 b) 3**2 c) 22%5 d) 13//4 6) From the sys module, by using which variable we can access command-line arguments? a) argsv b) argv c) arguments d) args 7) Consider the following code:print(type(eval(input('Enter some value:'))))if we enter 10 and 10.0 individually for every run what is the output? a) ? b) ?? c) ??? 8) Which type of exception will be raised if we are trying to call a method on the inappropriate object? a) IndexError b) TypeError c) AttributeError d) None of these 9) Which of the following are True? a) A try block can have any number of except blocks b) A try block can have any number of except blocks. c) A try block should be associated with atmost one finally block d) All the above 10) The base class for all exceptions in python is: a) ExceptionBase b) BaseException c) Exception d) EOFError
0%
Python (37)
Delen
Delen
Delen
door
Lyaisan14
Inhoud Bewerken
Afdrukken
Embedden
Meer
Toewijzingen
Scorebord
Meer weergeven
Minder weergeven
Dit scoreboard is momenteel privé. Klik op
Delen
om het publiek te maken.
Dit scoreboard is uitgeschakeld door de eigenaar.
Dit scoreboard is uitgeschakeld omdat uw opties anders zijn dan die van de eigenaar.
Opties Herstellen
Quiz
is een open template. Het genereert geen scores voor een scoreboard.
Inloggen vereist
Visuele stijl
Lettertypen
Abonnement vereist
Opties
Template wisselen
Alles weergeven
Er zullen meer templates verschijnen terwijl je de activiteit gebruikt.
Open resultaten
Kopieer link
QR-code
Verwijderen
Automatisch opgeslagen activiteit "
" herstellen?