Python without new line

Description

Python Program to print content in same line while using multiple print statements.

Solution

num1=int(input("Enter a First Number:"))
num2=int(input("Enter a Second Number:"))
print(num1,end='')
print(num2)

Explanation

by default print() function prints new line at the end, to avoid this you can use end parameter. Here value of end parameter is space.



Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution