Skip to main content

Posts

Showing posts from February, 2019

How to sum of two arrays in Python3:

Input Format: The first line of the input contains a number N representing the number of elements in array A. The second line of the input contains N numbers separated by a space. (after the last elements, there is no space) Output Format: Print the resultant array elements separated by a space. (no space after the last element) Example: Input: 4 2 5 3 1 Output: 3883 Explanation: Here array A is [1,2,3,4] and reverse of this array is [4,3,2,1] and hence the resultant array is [5,5,5,5]  SOURCE CODE: import math size=int(input()) list1=[] for x in input().split():   num=int(x)   list1=list1+[num]   for i in range(math.ceil(size/2)):     list1[i]=list1[size-1-i]=list1[i]+list1[size-1-i]     for i in range(size-1):       print(list1[i],end=" ")       print(list1[size-1],end="")

Find the largest number between two numbers in Python3

Input Format:   The first line of input contains two numbers separated by a space Output Format:   Print the larger number Example: Input:   2 3 Output:     3 SOURCE CODE: var1,var2=input().split() ma1=int(var1) ma2=int(var2) if(ma1==ma2):   print(0) if(ma1>ma2):   print(ma1) if(ma2>ma1):   print(ma2)

How to difference between two numbers in Python3:

Input Format:  The first line of the input contains two numbers separated by a space. Output Format :  Print the difference in single line Example: Input:   9 6 Output:    3 Explanation: Since the difference of numbers 4 and 2 is 2, hence the output is 2.   SOURCE CODE: a,b=input().split() c=int(a) d=int(b) x=c-d print(x)

How to take input in python3:

a = int(input())    //# this code will take a single input and store it in variable a //# this code will take a multiple input and store it in variable a,b,c,d. [a]=input(10).split() #[b]=input(12).split() #[c]=input(13).split() #[d]=input(14).split() print(input(),end="")

Know about Fuchsia OS

Fuchsia is a capability-based operating system currently being developed by Google. It first became known to the public when the project appeared on GitHub in August 2016 without any official announcement. In contrast to prior Google-developed operating systems such as Chrome OS and Android, which are based on the Linux Kernel, Fuchsia is based on a new microkernel called "Zircon". The GitHub project suggests Fuchsia can run on many platforms, from embedded systems to smartphones, tablets, and personal computers. In May 2017, Fuchsia was updated with a user interface, along with a developer writing that the project was not a "dumping ground of a dead thing", prompting media speculation about Google's intentions with the operating system, including the possibility of it replacing Android. Fuchsia is also a future based operating system,it will be grow or famous than android operating system and vice versa. Fuchsia OS is written by C,C++,Go,Rust,...