Python: Convert integer to string
Python Basic - 1: Exercise-144 with Solution
Write a Python program to convert integer to string.
Sample Solution-1:
Python Code:
language = "Python"
version = 3.6
print('Language: ' + language + ',' + ' Version: ' + str(version))
Sample Input:
language = "Python"
version = 3.6
Sample Output:
Language: Python, Version: 3.6
Sample Solution-2:
Python Code:
language = "Python"
version = 3.6
str_version = '{}'.format(version)
print('Language: ' + language + ',' + ' Version: ' + str_version)
Sample Input:
language = "Python"
version = 3.6
Sample Output:
Language: Python, Version: 3.6
Sample Solution-3:
Python Code:
language = "Python"
version = 3.6
str_version = "%s" % version
print('Language: ' + language + ',' + ' Version: ' + str_version)
Sample Input:
language = "Python"
version = 3.6
Sample Output:
Language: Python, Version: 3.6
Visualize Python code execution:
The following tool visualize what the computer is doing step-by-step as it executes the said program:
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
Previous: Write a Python program to print Emojis using unicode characters or CLDR (Common Locale Data Repository ) short names.
Next: Write a Python program to find the largest and smallest digit of a given number.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join