Wednesday, July 28, 2021

Installing Python on Windows Machine

Hey Guys! in this post we will be exploring the Installation procedure for Python 3 on Windows 10+ version Operating System.

Do I need to check anything before installation of Python?

Please check the version of Python is already installed using CMD window by typing 'python -V'.

Please be aware of your Operating system version by checking 'This PC' properties. 

How to install Python IDE on Windows System?

Step1: Download Python from Official Python website when you visit the website it automatically detects your Operating System and shows the download link. Here it will be Windows download!

Step 2: Run the exe file which was downloaded [the file name could be like Python-3.x.x-amd64.exe  ]


Navigate thru all the options you wish to choose select them. Please click on 'Install Now' option. Setup progress will show the green color progressbar it should completed by 100%; that's all

 

3:58 Installation of Python on Windows|Mac keep looking up to 10:22 Installation completes

Here we can see the screen shot of Python for Windows installation wizard steps.

Python installation on Windows 10 Laptop

Finally, when it is successful you can see the following Window saying 'Setup was successful'.



All set now we can do Validation of our installation, Verify the installation from your command prompt (CMD).
Window key + R then type cmd

python --version gives the installed version 

Python version validation in Windows command line


Hope you enjoyed this post!
If you find any issues in the installation process do let us know here as comment under this post.

Friday, July 2, 2021

AWS DevOps Engineer Online Exam Question

SRE DevOps Engineer Exam

Programming Language you can select any here I've selected as Python 3


Printing Last two digits 

You are given array consists of n integers. Print the last two digits of its array values. 


Given Inputs 

The first line of input contains an integer n, representing the number of elements in the given array. 

The second line of input contains n space separated integers, representing elements of the given array. 

2

25 10 


Expected Output 

Print the last two digits of the product of array values. 

Note that you always need to print two digits.


Constraints 

1<=n<=100

1<=ar[i]

ar[i] is the element of the array 

                ### YOUR TASK ###
                def output(arr):
                    ### Write you code logic here ###
                    
                    product_arr = 1
                    for i in arr:
                        product_arr*=i 
                    print("Product of array:",product_arr)
                    product_arr_str=str(product_arr)
                    return product_arr_str[-2:]
                
                # XOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOX #
                
                ### ALREADY GIVEN PROGRAM: ###
                
                # Product of given integer array elements 
                # print only last 2 digits of the product
                def convert_int(arr):
                    new_arr = []
                    for item in arr:
                        new_arr.append(int(item))
                    return new_arr
                
                # Input array
                InputArray = []
                n = int(input("Enter the number of elements:"))
                print(n)
                length = 0
                while True:  
                    InputArray = input("Enter Array with n spaces : ").split(' ')
                    print(len(InputArray))
                    if len(InputArray) == n:
                        break
                    else:
                    	print('Invalid , check the number of elements.' )
                        
                InputArray = convert_int(InputArray)
                
                # Call the function output passing InputArray
                print("last two digits of product array : ", output(InputArray))
                
            

Output :

Execution of the above program will be accepting the three numbers if not it will ask again for input..

As per the logic required to be product of 3 members will be displayed and last digits of the product will be displayed.



DevOps Foundation course

DevOps Foundation course
Join us to learn DevOps from the Beginning