Question

What does capitalizing bye do in this code? str='good-BYE' print (str.capitalize())

What does capitalizing bye do in this code?

str='good-BYE'

print (str.capitalize())

0 0
Add a comment Improve this question Transcribed image text
Answer #1

capitalize() method changes only the first character to upper case and remaining characters will be changed to lower case

Note: if the first character is in upper case it remains as it is.

str='good-BYE'

print (str.capitalize())

Output

Good-bye

Add a comment
Know the answer?
Add Answer to:
What does capitalizing bye do in this code? str='good-BYE' print (str.capitalize())
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
  • What does this code do? On the flipside of this paper, write the same code in...

    What does this code do? On the flipside of this paper, write the same code in Java. #include <stdio.h> #include <stdlib.h> int main ) ( char *str: (char *) malloc (15) ; str strcpy (str, "Iron"); printf("String 8u\n", str, str); Address %s, (char ) realloc (str, 25); str strcat (str, "Maiden"); Su\n", str, str): Address %s, printf ("String free (str) return (0); What does this code do? On the flipside of this paper, write the same code in Java. #include...

  • What value does this Processing code store in the s variable? String str = ""; int[]...

    What value does this Processing code store in the s variable? String str = ""; int[] a = {4, 8, 7, 8}; for (int i = 0; i < a.length; i++) { str = a[i] + str; } String s = str;

  • 1. Consider the following code segment. String str = "AP"; str += "CS " + 1...

    1. Consider the following code segment. String str = "AP"; str += "CS " + 1 + 2; System.out.println(str); What is printed as a result of executing the code segment? A: CS AP12 B: AP CS3 C: CSAP 12 D: APCS 12 E: APCS 3 2. Consider the following code segment. String dessert = "pie"; dessert += "straw" + dessert + "berry"; What is the value of dessert after the code segment has been executed? A: strawpieberry B: piestrawpieberry C:...

  • Output of following code? import re str = "The rain in Spain" x = re.findall("[arn]", str)...

    Output of following code? import re str = "The rain in Spain" x = re.findall("[arn]", str) print(len(x))

  • JAVA CODE String[] str = in.nextLine().split("\\s"); for(int i=0;i<=str.length;i++){ if (str[i].equals(stop)) break;    if(i%2==0){ System.out.print(str[i]+" "); }...

    JAVA CODE String[] str = in.nextLine().split("\\s"); for(int i=0;i<=str.length;i++){ if (str[i].equals(stop)) break;    if(i%2==0){ System.out.print(str[i]+" "); }    } lets say the INPUT for the array is: girl, boy, man, woman, girl, man, boy i dont want the array to print any string twice, i want the output to be like this: print all of them but print each once ---------- OUTPUT: girl, boy, man, woman

  • 7 - What does the code print to the screen? float x(float) 7/3; printf ( "...

    7 - What does the code print to the screen? float x(float) 7/3; printf ( " % .2 f", x); a) 7/3 b) 2.50 c) 2.00 d) None of the above a) TRUE b) FALSE c) TRUEFALSE d) None of the above 8 - What does the code print to the screen? int x3; if (x >31x!-2 printf ("TURE") printf ("FALSE"); 9What does the code print to the screen? a) TRUETRUE b) TRUE c) TRUETRUETRUE d) TRUETRUETRUETRUE e) None of...

  • What does the following code fragment print? char c[20] = "ABC"; cout << sizeof(c[2]) << endl;...

    What does the following code fragment print? char c[20] = "ABC"; cout << sizeof(c[2]) << endl; 2. What does the following code fragment print? char c[20] = "ABC"; c[3] = 'x'; cout << c << endl; 3. What does the following code fragment print? char c[20] = "ABC"; c[3] = 'x'; strcat(c, "ZZ"); cout << c << endl;

  • QUESTION 10 What will be the output of following code snippet? char *str; str = "%s";...

    QUESTION 10 What will be the output of following code snippet? char *str; str = "%s"; printf(str, "S"); A. S B. Garbage Value C. Compile-time Error D. Run-time Error 4 points    QUESTION 11 What will be the output of the following statements assuming that the array begins at the memory address location 7002 and size of an integer is 4 bytes? int a[3][4] = { 1, 2, 3, 4,                     5, 6, 7, 8,                     9, 10, 11, 12 }; printf("%d,...

  • 3. What does this code do? Write an explanation in English python n=1 while (n <1000):...

    3. What does this code do? Write an explanation in English python n=1 while (n <1000): print(n) n-n

  • Here is a PYTHON3 program can do the following encryption. string = "adam" string = hashlib.md5(str(string).encode())...

    Here is a PYTHON3 program can do the following encryption. string = "adam" string = hashlib.md5(str(string).encode()) for i in range(99):    string = hashlib.md5(str(string.hexdigest()).encode()) for i in range(100):    string = hashlib.sha256(str(string.hexdigest()).encode()) for i in range(100):    string = hashlib.sha512(str(string.hexdigest()).encode()) print("adam = ",string.hexdigest()) You will get a adam hashes to 6415d24f9fc04a9e0ed53c17eae60f6a7d97c1a5765a6d8d15a16f06c5be4c6dd047361bb01e5a2f424516b2992de23d69e8aee1cc6e0581cf6e2e3f63a22cd5 Use hashcat or python3 code to decrypt the following hashes. I want to know which word this hashes represent. 88466c23009271eb909e586c6707120f30a2dd6ae53fb025badb2f9d0f6765b90f124e3524d2d63719e8e668cf164411a61b1fea077ec1dd3b1db8889622095c

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