My Code:
exampleA= input("Give me an ExampleA\n") #hello
exampleB = input("Give me an ExampleAB\n") #<- here you should be able to write 50, 70, 80
for x in exampleA and exampleB:
print("nice" + exampleA) #<- i get nicehello
print("for" + exampleB) #
so i want for each element in exampleB Another print, but I get this output
nicehello
for50,70,80,90,20
nicehello
for50,70,80,90,20
nicehello
for50,70,80,90,20
but I want
nicehello
for50
nicehello
for70
nicehello
for80
by the way I'm a beginner in python
for x in exampleA and exampleB:shows a fundamental misunderstanding ofandwhich is a logical operator and so it amounts to asking if both the expressions"hello"and"50, 70, 80"are true. In natural language that makes no sense whatever, but Python has rules for converting such things toTrueandFalse, and like most implicit type coercions, it holds surprises for novices. If you want to know more, google for "Python truthy", but for now a simpler rule is don't use logical operators on strings (until you know what you are doing).