Python

Ace your homework & exams now with Quizwiz!

Which of the following operators in Python will produce a modulo of two provided numbers?

%

While performing the Echo Communication home project, the command socket.accept() crashed the script. What could be the problem?

The accept() command was not assigned with two variables.

You wrote a calculator script that accepts user input from input(). In order to make the code work properly, which of the following must be done to get mathematical results?

input() should be converted to int for create mathematical operations.

you wrote a script that dumps pdfs files from a chosen website into your Desktop. However, the code crashes with an error. What is the most suitable approach to solve the problem?

Implement a try-except statement

What would you use to convert one Python data type to another?

Casting

What type of variable is the 'x' in the fallowing code? x= '15'

String

Which commands would you use to gracefully exit in case of an error?

Try and Except

Which of the following is NOT a Python data structure?

Switch

How would you assign a tuple to variable myTuple?

myTuple = (1, 2, 'name , 'time' )

What is the purpose of the None keyword in python?

Define a null variable or object

Of the following, which is NOT an advantage of an interpreter compared to a compiler?

Speed

When accepting data in client-server communication, what is the meaning of recv(2048)?

The limit for the amount of bytes to accept

You installed PyCharm and started writing a little script that prints out "I love hacking with Python". However, PyCharm won't allow running the script. What can be the solution to the problem?

Setting an interpreter


Related study sets

Chapter 18 - Legal Issues: Recognizing Your Small Business Needs

View Set

Colorado Property & Casualty Insurance Law Supplement

View Set

SOC 350 Exam 1 Key Concepts - Chapter 1

View Set

BIOL 1215 Principles of Nutrition CH 1-3

View Set