by CodeChum Admin
I have a list of 3 numbers here with me that's already in the code editor, but I want you to add some more to this list by inputting some more numbers yourself in one line and then, print out only the even numbers from the list.
Can you do that for me?
Input
A line containing integers separated by a space.
33·54·32·11·8
Output
Multiple lines containing an integer.
2
54
32
8
by CodeChum Admin
I want you to make a array/list of numbers for me. All you have to do is make a program that will let me input any random integer in one line. Afterwards, it will then print out all the numbers I've inputted, on separate lines.
Care to do that for me?
Input
A line containing integers separated by a space.
1·64·32·2·11
Output
Multiple lines containing an integer.
1
64
32
2
11
Write a user-define function, called checkNumber(x), that takes as an input an integer
number (read in the main function using input) and prints out positive, negative, or
zero according to whether the number is positive, negative, or zero.
Programming languages like Python are formal languages with strict syntax rules. But those rules can change over time with newer versions of the programming language. Your textbook covers Python 3, but you may only have access to Python 2.
Download and install a working Python environment, preferably Python 3, or get an account with PythonAnywhere. Refer to the Software Requirements/Installation section of the course syllabus for details.
Type the statements below into your Python interpreter. For each statement, copy the output into your Discussion Assignment and explain the output. Compare it with any similar examples in the textbook, and describe what it means about your version of Python.
>>> print 'Hello, World!'
>>> 1/2
>>> type(1/2)
>>> print(01)
>>> 1/(2/3)
you are given a positive integer n. your task is to find the number of positive integers k<=n such that k is not divisible by any of the following numbers 2,3,4,5,6,7,8,9,10.
A pythagorean triplet is a set of three integers a, b and c such that a**2+b**2=c**2.in the given limit L, find the number of pythagorean triplets R that can be formed (such that a<b<c).
given an integer N, write a program that prints the count of the total numbers of digits between 1 and N.
write a program to find the sum S of the series where S = x-x^3+x^5+..... upto N terms.
Inputs
5
5
Output
Equal
If the given number are equal print "Equal". In all other cases, print "not equal"
given an integer number N as input. write a program to print the right-angled triangular pattern of N rows as shown below.