Save
Upgrade to remove ads
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

IT0011 FA3

QuestionAnswer
Given the code below: a = “Learning, Python!” print (a[2:4]) What will be the output? Ar
Given the code below: a = “Learning” b = “Python” c = a + b print (c) What will be the output? LearningPython
Given the code below: b = “Learning” print (len(b)) What will be the output? 8
Python does not have a character data type, a single character is simply a string with a length of 1. T
To get the length of a string, use the strip() function. F
An example of an illegal character is a double quote inside a string that is surrounded by double quotes. T
Given the code below: a = ‘the quick brown fox’ print (a[-3:]) What will be the output? fox
The split() method splits the string into substrings if it finds instances of the separator. T
Given the code below: b = “Python” print (len(b)) What will be the output? 6
Given the code below: x = “Success” print (len(x)) What will be the output? 7
What does the <readlines> method returns? list of lines
In the open() method, the first parameter is the name of a file including its path. T
Which of the following is used to open a file for both appending and reading? a+
A file method used to save the contents of a list of object in a file. writelines()
Which of the following is used to open a file for appending in binary format? ab+
To open a file in binary format, add "a" to the mode parameter. F
The buffer size argument is an optional parameter which decides the purpose of opening a file, e.g. read, write, append, etc. F
The built-in function bytearray() returns a byte representation of the object. T
The access mode parameter is an optional parameter which decides the purpose of opening a file, e.g. read, write, append, etc. T
readline() method reads the characters starting from the current reading position up to a newline character. T
Given the code below: a = ‘the quick brown fox’ print (a[:10]) What will be the output? the quick
Given the code below: a = ‘the quick brown fox’ print (a.upper ()) What will be the output? THE QUICK BROWN FOX
Given the code below: a = “Study, Program” print (a[-4:]) What will be the output? gram
Square brackets can be used to access elements of the string. T
String literals in python are surrounded by brackets. F
The lower() method removes any whitespace from the beginning or the end. F
The strip() method splits the string into substrings if it finds instances of the separator. F
Given the code below: a = “Learning, Python!” print (a[-5:-2]) What will be the output? tho
To open a file in binary format, add "___" to the mode parameter. b
Which of the following is used to open a file for appending? a
“____" mode allows reading only and not writing. r
Which of the following command is used to open a file “c:\tempt.txt” in reading mode only? file = open(“c:\\temp.txt”, “r”)
Which of the following is used to open a file for both reading and writing in binary format? rb+
The writelines() method used to save the contents of a list object in a file. T
Which of the following is incorrect file handling mode in Python. xr
Which of the following is incorrect file handling mode in Python. t+
You develop a Python application for your school. You need to read and write data to a text file. If the file does not exist it must be created. If the file has content the content must be removed. open(“local_data”, “w+”)
The replace() method replaces a string with another string. T
Given the code below: b = “Learning, Python!” print (len(b)) What will be the output? 17
The strip() method returns the string in lower case. F
The len() method takes the passed arguments. T
Given the code below: a = “Learning” b = “Python” c = a + b print (c) What will be the output? LearningPython
An example of an illegal character is a double quote inside a string that is surrounded by double quotes. T
The lower() method returns the string in lower case. T
Given the code below: a = “Learning” b = “Python” c = a + “ “ + b print (c) What will be the output? Learning Python
Which of the following is used to open a file for writing only? w
The file object has an inbuilt iterator. T
read(chars) method reads the specified number of characters starting from the current position. T
You need to read a file object that will be mapped to an image file called abc.txt. Which of the following is the correct syntax to use. open('abc.txt','r')
Which of the following is incorrect file handling mode in Python. v
The readline() method used to save the contents of a list object in a file. F
Which of the following is used to open a file for writing only in binary format? wb+
In order to add more data to existing file use the "a" or "a-" mode. T
Which of the following is incorrect file handling mode in Python. rz
Which of the following is incorrect file handling mode in Python. t+
Created by: xd-xdd
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards