conditional and loop
conditional and loop
Note : User is prompted to enter a guess. If the user guesses wrong then the prompt appears
again until the guess is correct, on successful guess, user will get a "Well guessed!" message,
and the program will exit.
2. Write a Python program to construct the following pattern, using a nested for loop.
3. Write a Python program to count the number of even and odd numbers in a series of
numbers
Sample numbers : numbers = (1, 2, 3, 4, 5, 6, 7, 8, 9)
Expected Output :
Number of even numbers : 5
Number of odd numbers : 4
4. Write a Python program that prints each item and its corresponding type from the following
list.
Sample List : datalist = [1452, 11.23, 1+2j, True, 'w3resource', (0, -1), [5, 12], {"class":'V',
"section":'A'}]