0
What's wrong? The output should be hihihihihi
x =str( input("hi")) y =int(input(5)) print (x*y)
8 Answers
+ 10
Zynab Naser
You are emplacing your variable within an input prompt, which is causing the error.
If you wish to use variables:
x = "hi"
y = 5
print(x*y)
If you wish to use inputs
x = input() # string
y = int(input()) # integer
print(x*y)
+ 3
Zynab Naser
x = "hi"
y = int(input())
print(x*y)
x & y are both variables which contain values.
input is merely a value which is determined by the user.
So if one variable is required to be prestated, then state the value of the variable.
+ 1
How can l solve an defined variable hi
+ 1
Zynab Naser Try This -
x = input()
y = int(input())
print(x*y)
This will solve your issues.
For defining a variable you can omit the input part and mention the value.
Like -
x = "SDB-"
y = int(input())
print(x*y)
+ 1
Zynab Naser not sure but try removing between the last 2 brackets ) ).
I've tried through mobile ide and through online interpreter and it works just fine.
+ 1
SymbolsOrganized
Review my answer in this thread
0
x = input ("hi")
y = int(input(5) )
print(x*y)
I just wrote it like this and it didn't work.
What is the wrong
0
I am a beginner but this beginning exercise has me confused please help...
x = ("hi")
y = int((5))
print (x*y)
results in zero ability to move forward...
I used your code vs my code...
x = ("hi")
y= (x*4)
print (y)
both results in hihihihihi change the numbers when using the word python... still nothing... What am I doing wrong....