Question

Python Language Problems 1. isdigit() A. Returns True if this string is just a digit. B....

Python Language Problems

1.

isdigit()

A. Returns True if this string is just a digit.

B. Returns True if this string contains only number characters.

C. Return True if this string has at least one number character.

D. is not a valid function.

2.

Pick the most accurate interpretation for the if construct:

if letter in words:

print("Got it")

A. If the character letter existed in the string words, it prints "Got it".

B. It traverse through the string words, every time it finds the character letter, it prints "Got it".

C. If the character letter existed in the string words, it prints "Got it"; letter could only be an alphabet

D. If letter existed in the string words, it prints "Got it"; letter could be either a single character or a string with multiple characters.

3.

Given that Cake is a class, what do we call this statement with respect to object and class:

my_large_lemon_cake = Cake(3, 'L')

A. Assignment    B. Constructor    C. Initializer    D. Function Call      E. None of the Above

4.

The instance of a class is

A. member function    B. member variable    C. an object    D. also a class     E. All of Above

5.

The attributes of an object can be categorized into

A.

1. Data

2. Non Data

3. Modules

B.

1. Modules

2. Sub-Modules

3. Behavior

C.

1. Member Variables

2. Member Functions

D.

1. Imported Modules

2. Local Modules

0 0
Add a comment Improve this question Transcribed image text
Answer #1
1.
B. Returns True if this string contains only number characters.

2.
D. If letter existed in the string words, it prints "Got it"; letter could be either a single character or a string with multiple characters.

3.
B. Constructor

4.
C. an object

5.
C.
1. Member Variables
2. Member Functions
Add a comment
Know the answer?
Add Answer to:
Python Language Problems 1. isdigit() A. Returns True if this string is just a digit. B....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Python The Python "<" and ">" comparison operators can be used to compare which string variable...

    Python The Python "<" and ">" comparison operators can be used to compare which string variable has a greater value based on comparing the ASCII codes of the characters in each string, one by one. To take some examples: "tets" > "test" returns True because the third letter of the first string, "t", has a greater value than the third letter of the second string, "s". "testa" > "test" returns True because—while the first four letters in both words are...

  • 1.1. Write a function named "areFirstTwoTheSame AsLast TwoChars" that accepts a string. It returns true if...

    1.1. Write a function named "areFirstTwoTheSame AsLast TwoChars" that accepts a string. It returns true if the first two characters and the last two characters of the string are the same. It returns false otherwise. In addition, if the string is empty or has only one character, it also returns false. For example, these are the strings with their expected return values false falsc "AB" true "ABA" false "ABAB" trus "ABBA" false "ABCABC false "ABCCAB" true 1.2 Write a function...

  • D.1 [3] Define a function called funD1...) that receives a string and returns a new string...

    D.1 [3] Define a function called funD1...) that receives a string and returns a new string with all the characters in the original string in an EVEN position. As an example, the following code fragment: print (funD1('abcde')) should produce the output: ace D.2 [6] Define a function funD2(...) which receives a list ist that contains single letters, single digits and single special characters and the list contains at least one element of each type). The function returns a string that...

  • C++ / Visual Studio Implement the member function below that returns true if the given value...

    C++ / Visual Studio Implement the member function below that returns true if the given value is in the container, and false if not. Your code should use iterators so it works with any type of container and data. template< typename Value, class Container > bool member( const Value& val, const Container& cont ); just implement this function in the code below #include <iostream> #include <array> #include <deque> #include <list> #include <set> #include <string> #include <vector> using namespace std; #define...

  • IN PYTHON Implement a function easyCrypto() that takes as input a string and prints its encryption...

    IN PYTHON Implement a function easyCrypto() that takes as input a string and prints its encryption defined as follows: Every character at an odd position i in the alphabet will be encrypted with the character at position i + 1, and every character at an even position i will be encrypted with the character at position i - 1. In other words, ‘a’ is encrypted with ‘b’, ‘b’ with ‘a’, ‘c’ with ‘d’, ‘d’, with ‘c’, and so on. Lowercase...

  • Write a Python function called more() that takes three string inputs and outputs a string Formally,...

    Write a Python function called more() that takes three string inputs and outputs a string Formally, the function signature and output are given by rucharist, char: str words str) > str Use the same names for the input arguments as shown above Note that charl and char2 will always be a string of length 1 (ie, it is a single character. The function checks which of charl or char2 appears more often in the word string and returns that character...

  • in C ++ containsTwice Language/Type: Related Links: Cboolean string caturn stine stlih Write ea function named...

    in C ++ containsTwice Language/Type: Related Links: Cboolean string caturn stine stlih Write ea function named containsTwice that accepts a string and a character as parameters and returns true if that character occurs two or more times in the string. For example, the call of cantainsTaice("helle", 1') should return true because there are two '1' characters in that sto Type your Ce solution code here: C lutson coe here h function cerce e C ntion

  • 1. DOES A DIGIT APPEAR IN AN INTEGER, Write a recursive function appears(n,i) that returns true...

    1. DOES A DIGIT APPEAR IN AN INTEGER, Write a recursive function appears(n,i) that returns true if the digit i appears in the positive (base 10) integer n, false if it does not in c++. ex. Enter a positive integer: 54321 Enter a digit: 7 The digit 7 does NOT appear in the integer 54321. 2. IS AN INPUT STRING A PALINDROME? A palindrome is a string in which the letters are the same in both directions, disregarding capitalization and...

  • I need help with this exercise. Than you for the help. Language is C++ 2 Enumeration...

    I need help with this exercise. Than you for the help. Language is C++ 2 Enumeration Data Types Reformat is the shell of a program designed to read characters and process them in the following way Lowercase character Uppercase character Digit Blank Newline Any other character Converts to uppercase and writes the character Writes the character Writes the digit Writes a blank Writes newline Does nothing / Program Reformat reads characters from file DataIn and // writes them to DataOut...

  • language is java Restrictions: You are not allowed to use anything from the String, StringBuilder, or...

    language is java Restrictions: You are not allowed to use anything from the String, StringBuilder, or Wrapper classes. In general, you may not use anything from any other Java classes, unless otherwise specified. You are not allowed to use String literals in your code ("this is a string literal"). You are not allowed to use String objects in your code. The methods must be implemented by manipulating the data field array, The CSString Class: NOTE: Pay very careful attention to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT