by CodeChum Admin
We've already counted digits before on a certain number, so how about doing it on strings and characters? There's a catch, though, since you're only going to count and see if the character exists at least twice in a string.
Instructions:
Input
The first line contains a single-letter string.
The second line contains a string.
e
CodeChum·is·awesome
Output
A line containing a string.
Cody·is·really·awesome
Write a program that takes three numbers as input from the user, and prints the largest.
Enter a number: 20
Enter a number: 50
Enter a number: 5
Largest: 50
Draw a flowchart and construct a python program to accept a list of N numbers. The job is to determine if there exists an element in the list such that the sum of the elements on its left is equal to the sum of the elements on its right. If such element exists, then print the index of the element. If there are no such elements, then the sum is zero.
Find the number of digits between 1 to N
example:
and so on...
an e-commerce company is planning to give a special discount on all <b><i>its</i></b> products to its customers for the christmas holidays. input: 7 9-13 8-7 18-10 18 output: 2
def lucky_number(name):
number = len(name) * 9
___ = "Hello " + name + ". Your lucky number is " + str(number)
___
print(lucky_number("Kay"))
print(lucky_number("Cameron"))
Describe how catching exceptions can help with file errors. Write three Python examples that actually generate file errors on your computer and catch the errors with try: except: blocks. Include the code and output for each example in your post.
Describe how you might deal with each error if you were writing a large production program. These descriptions should be general ideas in English, not actual Python code.
Given a number N, count the total number of digits from 1 to n
Draw a flow chart and construct a python program to accept a list of N numbers .the job is to determine if there Exists an element in the list such that sum of the elements on its left is equal to the sum of the elements on its right if such elements exists print index of elements.ifthere is no such elements then sum is zero
] Draw a flowchart and construct a python program to read the three subject’s marks secured by n students during FAT examination. If a student secured less than 50 in any subject, the student is failed in that subject. Count the number of students who failed in each subject and the total number of students who failed in at least one subject. [