Convert the Number
Given a number having ten digits, convert it to a string following the below-mentioned rules.
Rules for conversion:
1.separate the number into a set of four-three-three digits
2.Use the following prefixes for successive digits
a.Single numbers: just read them separately
b.Two consecutive numbers: double
c.Three consecutive numbers: triple
d.Four consecutive numbers: quadruple
Input
The first line of input is a string of ten digits.
Sample Input1
9887666668
sample Output1
nine double eight seven triplesix double six eight
Sample Input2
9090407368
Sample Output2
nine zero nine zero four zero seven three six eight
You can use a minus sign to make a negative number like -2. What happens for each of the following and why?
>>> 2++2
>>> 2--2
>>> 2+-2
>>> 2-+2
Given an integer N as input. Write a program the yellow right-angle pattern of N lines as bellow.
Note:There is a space after each asterisk (*) Character.
Input
The first line is an integer N
Explanation
In the given example the yellow right angled triangle of side 5 .Therefore, the output should be.
*
* *
* *
* *
* * * * *
Sample Input 1
4
Sample Output 1
*
* *
* *
* * * *
you cannot use built-in functions or NumPy or Pandas!
1. Write a function which finds all Pythagorean triplets of triangles whose sides are no greater than a natural number N.
2. Given a list of integers, write a function that finds the smallest and the largest value of this list. Given a list of numbers, write a function which finds their standard deviation
by CodeChum Admin
Now this one's a tad bit tricky, but you can definitely do it!
Instructions:
Input
A line containing five integers separated by a space.
1·2·3·4·5Output
A line containing an integer.
4084101by CodeChum Admin
We've tried adding together integers, now how about strings?
Instructions:
Input
A line containing two strings separated by a space.
hello·worldOutput
A line containing the concatenated string with no spaces.
helloworldeven or odd . write a program to check if the given number is even or odd
You task is to write a program that will continuously add friend data to a list named friends until the user enters "No". The program must display the contents of friend list.
friend's data to be collected:
Last name
First name
Birthdate
Gender
Contact No.
Validation:
Name must not be empty.
Must check the validity of the birth date.
Gender either F or M only.
Contact No. must be exactly 11 digits.
Display "Invalid Input" and ask the user to input another value.
Input
Friend's data
Tortor
Rhea
12/25/1990
F
09172345678
Yes
Nayang
Iya
11/11/1995
F
09172415679
No
Output
Name: Rhea Tortor
Birthdate: December 25, 1990
Gender: Female
Contact No.: 09172345678
Name: Iya Nayang
Birthdate: November 11, 1995
Gender: Female
Contact No.: 09172415679given integer n as input.write a program to print the sum of series of 1+11+111+...n terms
by CodeChum Admin
Now that we're done with integers, we're moving on to decimals!
Instructions:
Input
A line containing three decimal numbers with two decimal places separated by a space.
1.53·2.25·1.23Output
A line containing the result with two decimal places.
2.80