1/9
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
what is input and output
in Python, input refers to data received from the user or another source, while output is the data sent to the user or another destination. Together, they enable interaction with the program, allowing users to provide information and receive results. Input can be gathered using functions like input()
, while output can be displayed using print()
. These concepts are fundamental for developing interactive applications. Input allows user data entry, while output displays results. Input and output are essential concepts in Python programming that facilitate user interaction by allowing programs to receive data and display results.Input allows data entry, while output displays results to users, enabling interaction. Input and output in Python refer to data received from users or sources and data sent to users or destinations, respectively, enabling user interaction.
what are while loops
while loops (conditional loops)
number=1
while number <5:
print(number)
number= number+1
the loop will continue until a condition is met
what are for loops
for loops
for I in range (5):
print (“hello world”)
for I range (1,5):
print i
for I in (clothes):
print i
will print 5 times
you can specify the range
print items in a collection
what are variables
creating a variable
celsius = 25
using a variable
celsius*9/5 +32
what is a string(str)
any alphanumeric character e.g. “abcd12345” or “hello”
what is an interger(int)
whole numbers e.g.5
what is a float(float)
decimal point numbers e.g, 4.5
what are comparative operators
syntax. examples
==. equal to
!= not equal to
> greater than
<. less than
>= greater or equal to
<= less or equal to
what is selection
num=int (input("please enter a number"))
if num>10:
print ("too high")
else:
print ("thank you")
if num> 10:
print("too high")
elif num<5:
print ("too low")
else
print ("thank you")
what are text strings
single quoted
'perfect'
double quoted
'credit'