Can you explain why this program doesn’t run without credits=int(input())) What does this one line of code do to make everything else flow together?
Can you explain why this program doesn’t run without credits=int(input())) What does this one line of code do to make everything else flow together?
Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
Related questions
Question
100%
Can you explain why this program doesn’t run without credits=int(input()))
What does this one line of code do to make everything else flow together?
Expert Solution
Step 1
In python, the input() method is used to take the user input. But it will take the input as string. We need to typecaste it.
So for taking different data types input we need to typecast the method as:
int(input())
Float(input())
Etc.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage