F&A Diskussionen
When I enter two numbers the sum comes.. but when I input character as yes not y... Then it goes into an infinite loop... can anyone explain why?
int a,b;
char ch;
do
{
cout<<"Enter two numbers: ";
cin>>a>>b;
cout<<"The sum is "<<a+b
<<"\nDo you want to try again (y/n): ";
cin>>ch;
}while(ch=='Y'||ch=='y');
0 Stimmen
2 AntwortenHey there,
I don't know why, but when I import tkinter on IDLE like this:
from tkinter import *
And I say:
window = Tk()
Even known I use python 3.2.5, which should be able to use Tkinter, the python shell raises a ValueError that says that Tk() is not defined. I am very sure I use python 3.2.5 and tutorials from the Python Foundation say that is what I have to do. But it still doesn't work.
Does anyone have an idea of how to solve this problem? Thank you!
0 Stimmen
3 Antworten